大家好,帮我看一下这段代码错在哪里了,谢谢!
这是在VISUAL STUIDIO.NET中编写的,一直搞不明白到底错在哪里,帮我看看,太谢谢了!!private void sure_click(object sender, System.EventArgs e)
{
string myconnstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("./")+"..\\DataBase\\db1.mdb;";
OleDbConnection conn=new OleDbConnection(myconnstring);
string strsel="Select * From user";
OleDbCommand mycomm=new OleDbCommand(strsel,conn);
mycomm.Connection.Open();
OleDbDataReader dr=mycomm.ExecuteReader();
while(dr.Read())
{
string name;
string password;
name=dr["user"].ToString();
password=dr["password"].ToString();
if((name==user.Text)&&(password==pwd.Text))
{
Response.Redirect("successful.aspx");
}
else
{
Response.Redirect("regist.aspx");
}
}
dr.Close();
}