我这段从ACCESS数据库读一个值到控制台的程序哪里错了?求指导!!急! [code=C#][/code]using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.OleDb;
namespace DBtest { class Program { static void Main(string[] args) { string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;"; strConnection += @"Data Source=C:\Users\Dynames\Desktop\testDB\DBtest\DBtest.mdb"; OleDbConnection objConnection = new OleDbConnection(strConnection); objConnection.Open(); OleDbCommand command = new OleDbCommand("SELECT [english] FROM [main] WHERE ID=01", objConnection); OleDbDataReader reader = command.ExecuteReader(); reader.Read();
int k = (int) (reader["english"]); Console.WriteLine("{0}", k); reader.Close(); Console.ReadLine();