以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- sql (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=46163) |
-- 作者:cuicuibing -- 发布时间:2014/2/18 11:16:00 -- sql 帮忙看看运行后,没有增加记录。 Dim nms() As String = e.Form.Controls("CheckedComboBox1").text.split(",") \'获得接收用户名 Dim cmd As New SQLCommand cmd.ConnectionName = "shenchan" For Each nm As String In nms If nm = "" Then Return End If If nm = User.Name Then MessageBox.Show("不能给自己发信息!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Return End If cmd.CommandText = "Insert Into xinxi (fasong,jieshou,zhuangtai) Values (\'" & user.name & "\',\'" & nm & "\',0)" cmd.ExecuteNonQuery Next |
-- 作者:狐狸爸爸 -- 发布时间:2014/2/18 11:23:00 -- 看看会不会显示我执行了: Dim nms() As String = e.Form.Controls("CheckedComboBox1").text.split(",") \'获得接收用户名 Dim cmd As New SQLCommand cmd.ConnectionName = "shenchan" For Each nm As String In nms If nm = "" Then Return End If If nm = User.Name Then MessageBox.Show("不能给自己发信息!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Return End If cmd.CommandText = "Insert Into xinxi (fasong,jieshou,zhuangtai) Values (\'" & user.name & "\',\'" & nm & "\',0)" cmd.ExecuteNonQuery MessageBox.Show("我执行了!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Next |