以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  为什么以下代码不向SQL写入数据  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=52569)

--  作者:cqmeiyan
--  发布时间:2014/6/18 14:08:00
--  为什么以下代码不向SQL写入数据
            Dim conn As String=_Conn
            Dim cmd As New SQLCommand
            cmd.ConnectionName=conn
            cmd.CommandText="insert into tbl_pb (工號,日期,班次,部門,課別) values (\'" & bh & "\',\'" &  s_date & "\',\'" & bc & "\',\'" & dept & "\',\'" & kp & "\')"
            cmd.ExecuteNonQuery()

没有报错,但SQL中也没有写入数据


--  作者:Bin
--  发布时间:2014/6/18 14:09:00
--  
查看数据库没有数据?  查看狐表的表示需要重新加载才会显示的.
--  作者:cqmeiyan
--  发布时间:2014/6/18 14:15:00
--  
到SQL中查过没有数据
--  作者:Bin
--  发布时间:2014/6/18 14:16:00
--  
代码没有执行吧?  弹出CommandText 看看SQL语句是否有误 复制到SQL命令窗口执行看看.