asp.net和数据库的问题
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;Data Source=";
strConnection+=Server.MapPath("cnetdata\\cnet.mdb");
OleDbConnection dbconn=new OleDbConnection(strConnection);
dbconn.Open();
string strCom="select * from pwd where name=namebox.Text and password=pawbox.Text";
OleDbCommand mycommand = new OleDbCommand (strCom ,dbconn);
OleDbDataReader rder= mycommand.ExecuteReader();
if (rder.Read ()==true)
Response.Redirect("century.aspx");
else
Response.Redirect("index.aspx");
结果为:
“/WebApplication2”应用程序中的服务器错误。
--------------------------------------------------------------------------------
至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。
源错误:
行 70: string strCom="select * from pwd where name=namebox.Text and password=pawbox.Text";
行 71: OleDbCommand mycommand = new OleDbCommand (strCom ,dbconn);
行 72: OleDbDataReader rder= mycommand.ExecuteReader();
行 73: //OleDbCommand cmd=dbconn.CreateCommand();
行 74: //cmd.Connection =dbconn;
源文件: d:\inetpub\wwwroot\webapplication2\index.aspx.cs 行: 72
堆栈跟踪:
[OleDbException (0x80040e10): 至少一个参数没有被指定值。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
System.Data.OleDb.OleDbCommand.ExecuteReader()
WebApplication2.WebForm4.Button1_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\webapplication2\index.aspx.cs:72
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
请问这里哪里出错了啊,小弟求求各位大侠了,急的我要死了!!!!!!!!!!