Dim dst1 As Table = Tables("窗口1_table1") If dst1.count >0 Then If MsgBox("确认删除选中信息?",65,"提示") = 1 Then Dim dr As Row = dst1.Current '获得选定行 Dim str As String = dr("登陆账号") Dim cmd As New SQLCommand cmd.C '删除记录 cmd.CommandText = "DELETE FROM [login] WHERE 登陆账号 = '" & str & "'" cmd.ExecuteNonQuery() cmd.CommandText = "Select * FROM [login] WHERE 登陆账号 <> '" & str & "'" dst1.DataSource = cmd.ExecuteReader() For i As Integer=1 To dst1.count Dim dr1 As Row = dst1.Rows(i-1) dr1("登陆账号") = "" & i Next dst1.AutoSizeCols() End If End If
|