Connect data base to a windows form aplication


#1

hello,im using a free data base mysql. and i cant connect the server with my c# aplication, someone can give me some help?
and this is the code
string connetionString;
SqlConnection cnn;
connetionString = @“Data Source=den1.mysql5.gear.host
;Initial Catalog=Demodb;User ID=sa;Password=demol23”;
cnn = new SqlConnection(connetionString);
cnn.Open();
MessageBox.Show(“Connection Open !”);
cnn.Close();

thankks a lot


#2

So what exactly is the error message that you are getting? Are you able to connect to your database using one of Microsoft’s SQL Admin apps?


#3

In the code it looks like you are trying to connect to a SQL database. Try creating the free sql database and adding the correct details.