System.Data.SqlClient.SqlException: '=' 附近有语法错误。求解
protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse){stringsqlst...
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string sqlstr = "delete from ADMIN where = EMP_NO" + GridView1.DataKeys[e.RowIndex].Value.ToString();
SqlConnection myConnection = new SqlConnection("server= ;database= his; Trusted_Connection=SSPI");
myConnection.Open();
SqlCommand myCommand = new SqlCommand(sqlstr, myConnection);
myCommand.ExecuteNonQuery();
myConnection.Close();
GridView_DataBind();
} 展开
{
string sqlstr = "delete from ADMIN where = EMP_NO" + GridView1.DataKeys[e.RowIndex].Value.ToString();
SqlConnection myConnection = new SqlConnection("server= ;database= his; Trusted_Connection=SSPI");
myConnection.Open();
SqlCommand myCommand = new SqlCommand(sqlstr, myConnection);
myCommand.ExecuteNonQuery();
myConnection.Close();
GridView_DataBind();
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询