Connecting C# to a MYSQL database
Im receiving a MySqlException was unhandled on a line: conn.Open();
MySqlConnection conn = new
MySqlConnection("host=fdb5.freehostingeu.com;user=1477630_one;password=******;database=1477630_one;");
MySqlCommand cmd = new MySqlCommand("SELECT * FROM users WHERE
name = '"+name+"'AND surname = '"+ surname +"';");
cmd.Connection = conn;
conn.Open();
I think the format of my connection string is wrong. and I've tried
altering the values to see whether it's the problem but I'm still unable
to connect.
what am I doing wrong?
No comments:
Post a Comment