Foxtable(狐表)用户栏目专家坐堂 → 这段有语法错误,不知道错哪了


  共有2073人关注过本帖树形打印复制链接

主题:这段有语法错误,不知道错哪了

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/31 18:09:00 [显示全部帖子]

cmd.CommandText = "delete for m {会计科目} where 科目编码 =trv.SelectedNode"

 

改成

 

cmd.CommandText = "delete for m {会计科目} where 科目编码 = '" & trv.SelectedNode.FullName & "'"

[此贴子已经被作者于2016/7/31 18:49:39编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/31 18:11:00 [显示全部帖子]

Dim cmd As New SQLCommand
cmd.ConnectionName="cwgl"

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
If trv.SelectedNode IsNot Nothing
    Dim Result As DialogResult
    Result = MessageBox.Show("您真的要删除这个会计科目吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If Result = DialogResult.Yes Then
        cmd.CommandText = "delete for m {会计科目} where 科目编码 = '" & trv.SelectedNode & "'"
        cmd.ExecuteNonQuery()
        trv.SelectedNode.Delete
    End If
Else
    Messagebox.show("对不起,没有数据,无法删除!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If

[此贴子已经被作者于2016/7/31 18:10:58编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/31 18:49:00 [显示全部帖子]

 

Dim cmd As New SQLCommand
cmd.ConnectionName="cwgl"

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
If trv.SelectedNode IsNot Nothing
    Dim Result As DialogResult
    Result = MessageBox.Show("您真的要删除这个会计科目吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If Result = DialogResult.Yes Then
        cmd.CommandText = "delete for m {会计科目} where 科目编码 = '" & trv.SelectedNode.Text & "'"
        cmd.ExecuteNonQuery()
        trv.SelectedNode.Delete
    End If
Else
    Messagebox.show("对不起,没有数据,无法删除!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/31 18:50:00 [显示全部帖子]

 你目录树是怎样的啊?科目编码又是怎样的啊?

 回到顶部