2019-06-17
展开全部
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
For Each dr As DataGridViewRow In Me.DataGridView1.SelectedRows '选中行的集合
SQLzx(String.Format("DELETE FROM [table_name] WHERE [Column_name]='{0}'", dr.Cells("Column_name").Value.ToString)) '删除数据库
DataGridView1.Rows.Remove(dr) '删除选中行
Next
End Sub
For Each dr As DataGridViewRow In Me.DataGridView1.SelectedRows '选中行的集合
SQLzx(String.Format("DELETE FROM [table_name] WHERE [Column_name]='{0}'", dr.Cells("Column_name").Value.ToString)) '删除数据库
DataGridView1.Rows.Remove(dr) '删除选中行
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询