C# mysql database connection | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C# mysql database connection

am learning c# and am kind of stuck at how am to connect the mysql database to the my program. I just want a conntion method. eg. void connMethod (){ using(SqlConnection conn=new SqlConnection ) conn.ConnectionString="server=localhost; database =s_pos;password=;"; conn.open (); } I seem to get some server not found error.

11th Feb 2017, 12:25 AM
Issah Sidik
Issah Sidik - avatar
3 Answers
+ 5
try localhost ip 127.0 .0.1
11th Feb 2017, 12:30 AM
Samet Aydın
Samet Aydın - avatar
0
Andrew please details a bit
11th Feb 2017, 8:35 AM
Issah Sidik
Issah Sidik - avatar
0
please I can I my answers in this form void connMethod (){ using(SqlConnection conn=new SqlConnection ) conn.ConnectionString="server=localhost; database =s_pos;password=;"; conn.open (); }
11th Feb 2017, 12:31 PM
Issah Sidik
Issah Sidik - avatar