level 1
啦啦啦1676
楼主
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath() & "dbRNA.mdb"
Dim conn As New OleDb.OleDbConnection(str)
conn.Open()
Dim sql As String = "select * from user_tbl where uid='" & TextBox1.Text.ToString.Trim & "' and upwd='" & TextBox2.Text.Trim & "'"
Dim cmd As New OleDb.OleDbCommand(sql, conn)
Dim datareader As OleDb.OleDbDataReader = cmd.ExecuteReader
If datareader.Read() = True Then
Me.Hide()
form2.Show()
Else
MsgBox("登录信息错误")
End If
End class
有点问题怎么改啊,就是语句不能出现在方法体内 怎么弄啊,求教!!谢谢大神么么哒~·
2014年12月03日 06点12分
1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath() & "dbRNA.mdb"
Dim conn As New OleDb.OleDbConnection(str)
conn.Open()
Dim sql As String = "select * from user_tbl where uid='" & TextBox1.Text.ToString.Trim & "' and upwd='" & TextBox2.Text.Trim & "'"
Dim cmd As New OleDb.OleDbCommand(sql, conn)
Dim datareader As OleDb.OleDbDataReader = cmd.ExecuteReader
If datareader.Read() = True Then
Me.Hide()
form2.Show()
Else
MsgBox("登录信息错误")
End If
End class
有点问题怎么改啊,就是语句不能出现在方法体内 怎么弄啊,求教!!谢谢大神么么哒~·