Namespace - in order to connect to a database in .NET, you have to reference the Namespace that you will be using in your .aspx page. What is a Namespace?
"Put simply, a namespace is just a grouping of related classes. It's a method of putting classes inside a container so that they can be clearly distinguished from other classes with the same name." - read more here.
The Access namespace was easy - instructions for that are everywhere. Here is the crucial line, at the top of the code on line 2: <%@ Import Namespace="System.Data.OleDb" %> (see http://kevlaur.net/AccessingAccessData.aspx for a code listing).
The MySQL Namespace took some searching. I had a false start with an open source namespace written by a programmer, then I found a better solution on the MySQL website. You download the .dll and place it in the /bin folder, then it is referenced this way:
<%@ Import Namespace="MySql.Data" %>
<%@ Import Namespace="MySql.Data.MySqlClient" %>
No comments:
Post a Comment