如何读取Access中的数据啊
各位大侠帮我看下有什么错啊
string connectionString =
"provider=Microsoft.Jet.OLEDB.4.0;" +
"data source=C:\\Documents and Settings\\Administrator.310C7DBA925B462\\桌面\\db2.mdb";
OleDbConnection myOleDbConection = new OleDbConnection(connectionString);
OleDbCommand myOleDbCommand = new OleDbCommand("select * from emp_test", myOleDbConection);
=
"SELECT customerID,CompanyName,contactName,Address " +
"FROM db2 " +
"WHERE cunstomerID ='ALFKI'";
myOleDbConection.Open();
OleDbDataReader myOleDbDataReader = myOleDbCommand.ExecuteReader();//(**)
myOleDbDataReader.Read();
Console.WriteLine(myOleDbDataReader["customerID"]);
Console.WriteLine(myOleDbDataReader["CompanyName"]);
Console.WriteLine(myOleDbDataReader["contactName"]);
Console.WriteLine(myOleDbDataReader["Address"]);
myOleDbDataReader.Close();
myOleDbConection.Close();
我一运行 就把(**)那句标黄了,由于本人太菜不知道是什么原因导致的,还请各位大侠帮忙