-3
我得到錯誤..錯誤:Incorrect syntax near 's'
附近有語法錯誤 'S'
代碼:
con = new SqlConnection("Data Source=DELL-PC;Initial Catalog=sashi;Integrated Security=True");
con.Open();
SqlCommand sc = new SqlCommand("INSERT INTO Login VALUES('" + textBoxUID.Text + "','" + textBoxPWD.Text + "','" + comboBoxQUN.Text + "','" + textBoxANS.Text + "') ", con);
sc.ExecuteNonQuery();
MessageBox.Show("Record has been inserted");
con.Close();
我忘了什麼或者是錯誤?
yes ..只有4列 – 2014-10-29 07:36:20
現在出現錯誤ExecuteNonQuery:連接屬性尚未初始化。 – 2014-10-29 07:39:59
現在該做什麼? – 2014-10-29 07:40:16