[Mono-list] newbie:help connecting with nysql 5.0

rupanu pal rupanu.pal at rediffmail.com
Mon Jul 2 06:29:41 EDT 2007


hello there,       I have just got started with mono and having a trouble connecting with Mysql 5.0..It seems it can\'t find the driver needed.I have mysql connector/.net 1.0.9....but can\'t get that working.I read somewhere mono needs 1.0.7 of that connector ,but I can\'t find that version anywhere.Can anyone please tell me which driver to use and a sample code snippet to connect to mysql.Now I am using the sample snippet given in the MONO official site :-****************************************************************************************using MySql.Data.MySqlClient;using MySql.Data;public class Default : Page    {                public virtual void onButtonClick(object sender, EventArgs e)        {            string connectionString =\"Server=localhost;\" + \"Database=test;\" + \"User ID=root;
 \" + \"Password=mysql;\" + \"Pooling=false\";       IDbConnection dbcon;       dbcon = new MySqlConnection(connectionString);       dbcon.Open();       IDbCommand dbcmd = dbcon.CreateCommand();             string sql =           \"SELECT name, age \" + \"FROM table1\";       dbcmd.CommandText = sql;       IDataReader reader = dbcmd.ExecuteReader();       while(reader.Read()) {            string name = (string) reader[\"name\"];            string age = (string) reader[\"age\"];            Response.Write(\
 "Name :- \"+name+\"Age :- \"+age);       }       // clean up       reader.Close();       reader = null;       dbcmd.Dispose();       dbcmd = null;       dbcon.Close();       dbcon = null;            Response.Write(\"Hello\");                    }    }*******************************************************************************************and the error I am getting now is :-#################################################################################[Task:File=/home/rupanupal/Projects/NewTest/NewTest/Default.aspx.cs, Line=26, Column=20, Type=Error, Priority=Normal, Description=The type or namespace nam
 e `MySqlConnection\' could not be found. Are you missing a using directive or an assembly reference?(CS0246)]###################################################################################I have the above two references already added.What might be the issue???Please suggest a way.Thanking you all...R. Pal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070702/452a04dd/attachment.html 


More information about the Mono-list mailing list