-
November 9th, 2006, 04:29 AM
#1
MySQL Connector Net 1.08 and C# (Closed)
Hello everybody
I want to connect to a MySQL 5.0 database under C# using the MySQL Connector Net 1.08 drivers. I know that I need to use the MySQLConnector object. But that object is not recognized by the compiler and I thus get a compilation error.
Do I need to add some sort of reference in the IDE of the compiler?
George Papadopoulos
Last edited by divined; November 13th, 2006 at 04:27 AM.
-
November 9th, 2006, 07:23 AM
#2
Re: MySQL Connector Net 1.08 and C#
-
November 10th, 2006, 04:01 AM
#3
Re: MySQL Connector Net 1.08 and C#
Fine. But the compiler responds with an error when I use the C# code :
Code:
MySql.Data.MySqlClient.MySqlConnection conn;
string myConnectionString;
myConnectionString = "server=127.0.0.1;uid=root;" +
"pwd=12345;database=test;";
try
{
conn = new MySql.Data.MySqlClient.MySqlConnection();
conn.ConnectionString = myConnectionString;
conn.Open();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
MessageBox.Show(ex.Message);
}
and the error I get is
Error 1 The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\divined\Τα έγγραφά μου\Visual Studio 2005\Projects\MySQL_test\MySQL_test\Program.cs 13 9 MySQL_test
What namespace do I need to use in order for the MySQL namespace to be found?
I added a reference to MySQL.Data.dll now but still the IDE of Visual Studio 2005 Express cannot find the MySQL namespace.
Last edited by divined; November 10th, 2006 at 04:10 AM.
-
November 11th, 2006, 06:29 AM
#4
Re: MySQL Connector Net 1.08 and C#
-
November 13th, 2006, 04:25 AM
#5
Re: MySQL Connector Net 1.08 and C#
thanks for the link. A rather focal point for anything related to MySQL Connector.
-
November 22nd, 2006, 05:30 PM
#6
Re: MySQL Connector Net 1.08 and C#
Thats nice, Aniskhan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|