Last post Mar 25, 2011 06:24 AM by hemant.yadav
Mar 24, 2011 02:20 AM|direct_tarun|LINK
i m using vs 2010 professional i want to connect it to mysql database....pls give me a piece of code for that...and tell me where i have to make changes....plssss help me out thnks in advance...
Mar 24, 2011 02:35 AM|stanly|LINK
Mar 25, 2011 05:24 AM|hemant.yadav|LINK
Download mysql connector for .net and installed it in your system
after installing the connector reference the library and MySql.Data;
private void button1_Click(object sender, System.EventArgs e)
string MyConString = "SERVER=localhost;" +
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
command.CommandText = "select * from mycustomers";
Reader = command.ExecuteReader();
string thisrow = "";
for (int i= 0;i<Reader.FieldCount;i++)
thisrow+=Reader.GetValue(i).ToString() + ",";
Mar 25, 2011 05:39 AM|direct_tarun|LINK
i have downloaded connector for vs 2010...and install it....now plsss tell me what all changes i have to do in web.config and machine.config........or tell is there any other place or file in which i have to change....plsss tell me the complete process i
m stuck....thnx in advance....
Mar 25, 2011 06:24 AM|hemant.yadav|LINK
have you tested the example which i have posted in my last post?
If not than only you need to add reference of MySql.Data in your project nothing else and you will able to used it
are you getting any error in your in my code which i have posted?