以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助] (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=50050) |
||||
-- 作者:riyuan -- 发布时间:2014/4/28 16:02:00 -- [求助] 在点击删除按钮后,窗口中表会自动消失,不能立即显示删除后的剩余数据。请指教
|
||||
-- 作者:Bin -- 发布时间:2014/4/28 16:11:00 -- 不明白你想做什么 cmd.CommandText = "DELETE FROM [login] WHERE 登陆账号 = \'" & str & "\'" cmd.ExecuteNonQuery() dst1.DataSource = cmd.ExecuteReader() 执行删除语句怎么 可以只想完了,又执行ExecuteReader呢? |
||||
-- 作者:lsy -- 发布时间:2014/4/28 16:16:00 -- 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 |