送分:谁能帮我注释这段代码啊?VB.NET

来源:百度知道 编辑:UC知道 时间:2024/06/22 20:58:11
Dim constr As String
Public Function connstr() As String
constr = "workstation id=94C304A75CD24EB;packet size=4096;integrated security=SSPI;initial catalog=jdgl;persist security info=False"
Return constr
End Function

'管理员/会员 登录
Public Function validateLogin(ByVal uid As String, ByVal pwd As String, ByVal usertype As String) As Boolean
Dim t As New Boolean
Dim sqlConn As New SqlConnection(Me.connstr())
sqlConn.Open()
Dim sqlCom As New SqlCommand("IsuserLogin", sqlConn)
sqlCom.CommandType = CommandType.StoredProcedure
sqlCom.Parameters.Add("@Au_username", SqlDbType.VarChar, 50).Value = uid
sqlCom.Parameters.Add("@Au_password", SqlDbType.VarChar, 50).Value = pwd
sqlCom.Parameters.Add("@Au_usertype", SqlDbType.VarChar, 50).Value = usertype
If sqlCom.ExecuteSc

("@Au_username", SqlDbType.VarChar, 50).Value = uid
@Au_username: 给存贮过程中的 这个参数传值
SqlDbType.VarChar : 传值的类型,是SQL中@Au_username定义的类型,varchar
50 : 是值的大小。
uid : 是vB中需要给@Au_username赋值的变量

就是这一段看不懂
'设置调用数据库的命令类型为【存储过程】
sqlCom.CommandType = CommandType.StoredProcedure

'为sqlCom添加参数(以便传给存储过程)
sqlCom.Parameters.Add("@Au_username", SqlDbType.VarChar, 50).Value = uid
sqlCom.Parameters.Add("@Au_password", SqlDbType.VarChar, 50).Value = pwd
sqlCom.Parameters.Add("@Au_usertype", SqlDbType.VarChar, 50).Value = usertype