간단한 코드를 만들었지 만, 뭔가 잘못되어있는 것처럼 보입니다. "Insert"에 대한 오류가 발생합니다. 나는 무엇을 잘못 했는가?sql 오류 삽입 ("where")
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand(
"insert into dbo.UserInfo (Login, Password, UserType, ID) where Login [email protected] and [email protected] and [email protected] ", con);
{
cmd.Parameters.AddWithValue("@Login",TextBox1.Text);
cmd.Parameters.AddWithValue("@Password", TextBox2.Text+".123");
cmd.Parameters.AddWithValue("@Type", DropDownList1.SelectedValue);
int rows = cmd.ExecuteNonQuery();
con.Close();
}
무엇이 오류였습니까? – Gajendra
'where'키워드 근처의 구문이 잘못되었습니다. – user2121038
행을 업데이트하거나 where 절을 그대로 두려면 insert 대신 update를 사용하십시오. – insomniac