主题:这一段代码哪里错了,急!!!在线等
Try
Me.Text = "正在验证..."
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
Dim comstr As String
Dim mydataset As New DataSet()
comstr = " select 密码 from " & CmbPurview.Text & " where 用户名 = ' " & Trim(TxtUserName.Text) & " ' "
mydataset.Clear()
Dim adapter As New SqlDataAdapter(comstr, SqlConnection1)
adapter.Fill(mydataset, "table1")
'判断密码是否正确
If mydataset.Tables("table1").Rows(0).Item(0) = Trim(TxtPassword.Text) Then
'如果查找不到任何行,则此处出现异常
userinf(0) = Trim(TxtUserName.Text)
userinf(1) = CmbPurview.Text
If CmbPurview.Text <> "管理员" Then
With ob_interface
.BtGoods.Visible = False
.BtFinance.Visible = False
.BtEmployee.Visible = False
.BtSaleHistory.Visible = False
End With
End If
ob_interface.Show()
Me.Hide()
Else
MsgBox("密码错误")
TxtPassword.Text = ""
Me.Text = ""
Me.Cursor = System.Windows.Forms.Cursors.Arrow
TxtPassword.Focus()
End If
Catch ex As Exception
'异常处理
MsgBox("用户不存在!", MsgBoxStyle.OKOnly, "提示")
TxtUserName.Text = ""
TxtPassword.Text = ""
Me.Text = ""
Me.Cursor = System.Windows.Forms.Cursors.Arrow
End Try
End Sub
还有出现两个错
C:\Documents and Settings\MyFjh\My Documents\商场管理系统\商场管理系统\Form1.vb(206): 名称“ob_interface”未声明。
Me.Text = "正在验证..."
Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
Dim comstr As String
Dim mydataset As New DataSet()
comstr = " select 密码 from " & CmbPurview.Text & " where 用户名 = ' " & Trim(TxtUserName.Text) & " ' "
mydataset.Clear()
Dim adapter As New SqlDataAdapter(comstr, SqlConnection1)
adapter.Fill(mydataset, "table1")
'判断密码是否正确
If mydataset.Tables("table1").Rows(0).Item(0) = Trim(TxtPassword.Text) Then
'如果查找不到任何行,则此处出现异常
userinf(0) = Trim(TxtUserName.Text)
userinf(1) = CmbPurview.Text
If CmbPurview.Text <> "管理员" Then
With ob_interface
.BtGoods.Visible = False
.BtFinance.Visible = False
.BtEmployee.Visible = False
.BtSaleHistory.Visible = False
End With
End If
ob_interface.Show()
Me.Hide()
Else
MsgBox("密码错误")
TxtPassword.Text = ""
Me.Text = ""
Me.Cursor = System.Windows.Forms.Cursors.Arrow
TxtPassword.Focus()
End If
Catch ex As Exception
'异常处理
MsgBox("用户不存在!", MsgBoxStyle.OKOnly, "提示")
TxtUserName.Text = ""
TxtPassword.Text = ""
Me.Text = ""
Me.Cursor = System.Windows.Forms.Cursors.Arrow
End Try
End Sub
还有出现两个错
C:\Documents and Settings\MyFjh\My Documents\商场管理系统\商场管理系统\Form1.vb(206): 名称“ob_interface”未声明。