帮忙看看运行后,没有增加记录。
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