gridview刪除選中行 asp.netc#如何刪除gridview選中一行數(shù)據(jù)?
asp.netc#如何刪除gridview選中一行數(shù)據(jù)?雙擊GridView的rowdeleting事件,并編寫以下(引用)字符串sqlstr=“delete from table where id=
asp.netc#如何刪除gridview選中一行數(shù)據(jù)?
雙擊GridView的rowdeleting事件,并編寫以下(引用)字符串sqlstr=“delete from table where id=”“GridView 1。數(shù)據(jù)鍵Value.to字符串()“”“sqlcon=new SqlConnection(strCon)sqlcom=new SqlCommand(sqlstr,sqlcon)sqlcon.打開() sqlcom.ExecuteNonQuery() sqlcon.關閉()Bind()//數(shù)據(jù)綁定函數(shù)添加gridview1。Datakeynames=new string[]到綁定函數(shù){“ID”}//主鍵