Error With Dynamically Created SQL Insert statement
问题 May I know what's wrong with my statement? I receive a syntax error. Been trying to find out what's wrong all day. :( cmd.CommandText = "INSERT INTO LogIn(Username,Password) VALUES('" + AddUsernameTextBox.Text + "','" + AddPasswordTextBox.Text + "')"; 回答1: cmd.CommandText = "INSERT INTO LogIn([Username],[Password]) VALUES('" + AddUsernameTextBox.Text + "','" + AddPasswordTextBox.Text + "')"; This code will help if the error is due to reserved keywords :- username and password. Please quote