using (OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Data\db.mdb;Persist Security Info=False"))
{
conn.Open();
string sql = "SELECT Id,Name,Gender,Birthday,IdentityCode,HomeAddress,EmployeeId FROM tb_employee";
OleDbCommand cmd = new OleDbCommand(sql, conn);
using (IDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
int Id = reader.GetInt32(0);
string Name = reader.GetString(1);
int Gender = reader.GetInt32(2);
DateTime Birthday = reader.GetDateTime(3);
string IdentityCode = reader.GetString(4);
string HomeAddress = reader.GetString(5);
string EmployeeId = reader.GetString(6);
}
}
}