我做了个写了登陆的简单代码,用ACCESS数据库,以前没有用过,用的是SQL SERVER
  但现在有个问题总报错,请高手指点其中    Dim dr As OleDbDataReader = cmd.ExecuteReader这句系统提示 异常,碉用了另外一个函数。
Imports System.Data
Imports System.Data.OleDbPartial Class _Default
    Inherits System.Web.UI.Page    Private Sub page_load(ByVal sender As System.Object, ByVal e As EventArgs)
       
    End Sub    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click        Dim con As New OleDbConnection
        con.ConnectionString = "provider = Microsoft.Jet.OLEDB.4.0;DATA Source=" & Server.MapPath("tzdatabase.mdb")
        con.Open()        Dim str As String = "select * from login where user=" + TextBox1.Text + " and " + TextBox2.Text + ""
        Dim cmd As New OleDbCommand(str, con)
        Dim dr As OleDbDataReader = cmd.ExecuteReader
       If dr.Read Then
            Response.Redirect("cg.aspx")
        Else
            Response.Write("<script languge='javascript'> alert('登录失败');window.top.location.href='Default.aspx';</script>;return")        End If    End Sub    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""    End Sub    Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
        Response.Redirect("rigester.aspx")    End Sub
End Class