Below is the code to insert value into mysql database, using datagridview. But the selectcommand is working.It is not happening since i get error stating \"Column \'username
I am rather unsure, but doesn't mysql use numbered parameters with a "?"-synatx or named parameters with a ":"-syntax instead of (mssql) at-syntax ?
Something like :
MySqlCommand insertcommand = new MySqlCommand("insert into user(username,password) values(?, ?)", conn);
insertcommand.Parameters.Add(1, MySqlDbType.VarChar,50,"username");
insertcommand.Parameters.Add(2, MySqlDbType.VarChar, 50, "password");
or
MySqlCommand insertcommand = new MySqlCommand("insert into user(username,password) values(:username, :pass)", conn);
insertcommand.Parameters.Add(":username", MySqlDbType.VarChar,50,"username");
insertcommand.Parameters.Add(":pass", MySqlDbType.VarChar, 50, "password");