ACCESS数据库 急!!!
try{
OleDbConnection thisConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=I:\C#\学生管理系统\student\student\db\student.mdb");
thisConnection.Open();
string sqlString = "SELECT * from user";
OleDbCommand cmd = new OleDbCommand(sqlString, thisConnection);
OleDbDataReader thisReader = cmd.ExecuteReader();
while (thisReader.Read())
{
if ((name == thisReader["usename"]) && (pwd == thisReader["password"]))
{
this.Hide();
new main().Show();
}
else
{
MessageBox.Show("用户名或密码错误,请重新输入!");
textBox1.Clear();
textBox2.Clear();
}
}
}
catch (Exception ee)
{
MessageBox.Show(ee.Message.ToString());
}
里面哪里错了呀?