求助!登录不能实现功能,求高手指教!!!
“/web”应用程序中的服务器错误。--------------------------------------------------------------------------------
至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。
源错误:
行 49: conn1.Open()
行 50: Dim cmd1 As New OleDbCommand(strsql1, conn1)
行 51: Dim dr1 As OleDbDataReader = cmd1.ExecuteReader()
行 52: If dr1.Read() Then
行 53:
源文件: C:\Users\admin\Desktop\作业\txl\web\Default.aspx.vb 行: 51
堆栈跟踪:
[OleDbException (0x80040e10): 至少一个参数没有被指定值。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) +992156
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +255
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +188
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +58
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +161
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +116
System.Data.OleDb.OleDbCommand.ExecuteReader() +6
_Default.Button1_Click(Object sender, EventArgs e) in C:\Users\admin\Desktop\作业\txl\web\Default.aspx.vb:51
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
以上是出错的提示,我的代码如下,求高手指教,谢谢!!!
Dim name1 As String = TextBox1.Text
Dim pass1 As String = TextBox2.Text
Dim strcon1 As String
strcon1 = "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("txl.mdb")
Dim conn1 As New OleDbConnection(strcon1)
Dim strsql1 As String = "select * from 用户表 where username='" + name1 + "' and password='" + pass1 + "'"
conn1.Open()
Dim cmd1 As New OleDbCommand(strsql1, conn1)
Dim dr1 As OleDbDataReader = cmd1.ExecuteReader()
If dr1.Read() Then
Response.Redirect("find1.aspx")
ElseIf Session("name") = "admin" And Session("pass1") = "123456" Then
Response.Redirect("main.aspx")
Else
Label1.Text = "请输入正确的用户名!!!"
End If