Hello all.
First i want to say it good to be here with you people. Im trying to do someting for my school project and i need help.
I have my mysql database on dreamhost server and i make program to test my connection on that database and i get every time message that it cant connect.
here is the code:
and i post photo of my program.

Please help me and thank you all.
First i want to say it good to be here with you people. Im trying to do someting for my school project and i need help.
I have my mysql database on dreamhost server and i make program to test my connection on that database and i get every time message that it cant connect.
here is the code:
private void button1_Click(object sender, EventArgs e) { string connetionString = null; SqlConnection connection; SqlCommand command; string sql = null; string serverName = textBox1.Text; string databaseName = textBox2.Text; string userName = textBox3.Text; string Password = textBox4.Text; int num = 1; connetionString = "Data Source=" +serverName+ ";Initial Catalog=" +databaseName+ ";User ID=" +userName+ ";Password=" +Password+ ""; sql = "SELECT * FROM mitAdminLogIn WHERE adminID =" +num+ ""; connection = new SqlConnection(connetionString); try { connection.Open(); command = new SqlCommand(sql, connection); command.ExecuteNonQuery(); command.Dispose(); connection.Close(); MessageBox.Show(" ExecuteNonQuery in SqlCommand executed !!"); } catch (Exception ex) { MessageBox.Show("Can not open connection ! "); } }
and i post photo of my program.

Please help me and thank you all.