使用sqlcommand时,如何接收返回值
kimcz 2002-04-19 03:26:39 这是一个简单的用vb.net登陆界面代码,在aspx文件来实现功能。
需要的是sqlcommand命令执行后的返回值和,返回值达不到要求时出现警告窗口功能。以下程序中用中文写的地方和 '后面部分不知道怎么编。
请高手指点。
Dim LoginID As String
Dim LoginPWD As String
Dim sqlstring As String
Dim mycommand As SqlCommand
LoginID = TextBox1.Text
LoginPWD = TextBox2.Text
If LoginID = "" Then
'MsgBox("aaa")
End If
If LoginPWD = "" Then
'MsgBox("aa", MsgBoxStyle.OKOnly, "done")
End If
mycommand = New SqlCommand()
mycommand.CommandText = "select * from friend010t where friend_ID = '" & LoginID & "' and PWD = '" & LoginPWD & "'"
If 我想在这里用返回值比较 Then
true时去另外一个界面 ' 在这里转到另一个界面的代码应该怎么编?
Else
false时弹出警告窗口 '上面用的msg函数为什么不能用?应该怎么用?
End If
如果以上代码写完之后,实现功能时有没有安全性的问题?
我对安全性的问题一窍不通,请一并指点(只关于以上代码,多说了没用,因为我理解不了。)。