|
|
#2
我是小丽2013-12-05 19:17
我把这块程序都贴上吧,看的清楚
Public Class DBuser Private _UserName As String Private _Password As String Property username() As String Get Return _UserName End Get Set(ByVal value As String) _UserName = value End Set End Property Property passward() As String Get Return _Password End Get Set(ByVal value As String) _Password = value End Set End Property Sub New(ByVal Name As String, ByVal PWD As String) _UserName = Name _Password = PWD End Sub Function LoginConfirm() As Boolean Dim SQLString As String SQLString = "SELECT * FROM 用户信息表 WHERE 用户名='" & _UserName & "' AND 密码='" & _Password & "'" Dim UserTable As DataTable = DBOperation.DBOperate(SQLString) '判断输入的信息在数据库中是否存在记录 If UserTable.Rows.Count = 0 Then MsgBox("你输入的用户名和密码不正确,请重新输入!", MsgBoxStyle.Exclamation, "消息框") Return False '没有信息则返回失败,说明输入的信息不正确. Else Return True End If End Function Protected Overrides Sub Finalize() MyBase.Finalize() End Sub End Class |
用的是vs2010,Access2003.
这个错误不懂什么意思,是要重新安装才行吗?
Sub New(ByVal Name As String, ByVal PWD As String)
_UserName = Name
_Password = PWD
End Sub
Warning:'Public Sub New(Name As String, PWD As String)' in designer-generated type 'KTV.DBuser' should call InitializeComponent method.
D:\可视化\KTV\KTV\DBuser.vb
should call InitializeComponent method,这句话的意思是应该调用初始化组件,在网上搜了一下,搞不懂