Thanks
C#: Connecting to mysql database
I would like some information on how to connect to a MySQL database using C#. I would also like to know on how to retrieve data from the MySQL database and put the retrieved information in a listview.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
John DebonoPosted Apr 20, 2013, 2:56 AM
Santosh YadavPosted Apr 19, 2013, 11:54 PM
First of all the connection string will be :
con="Data Source=datasourcename; uid=root; pwd=12345;database=db1";
here password could be your desired text but user id is by default root in mysql.
Then you have to download a DLL named as MySql.Data.dll. It has the class and methods like System.data.SqlClients DLL. So you can use it easily.
Javeed M ShaikhPosted Apr 19, 2013, 11:05 AM
http://www.c-sharpcorner.com/UploadFile/8af3e0/connecting-to-mysql-using-C-Sharp-net/
here is the link on populating the grid ( you can look at the code and use it similar for listview)
http://www.c-sharpcorner.com/UploadFile/65fc13/linq-with-mysql-database-in-visual-studio-2010/