我在控制台里写了一个数据库的c#写的,运行出错,各位大哥哥帮帮忙看看我程序怎么回事!、
using System;
using System.Data;
using System.Data.OleDb;
namespace ConsoleApplicationTest
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class HelloWorld
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
OleDbConnection thisConnection=new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\ConsoleApplication1\dbeasyad.mdb;");
thisConnection.Open();
OleDbCommand thisCommand=thisConnection.CreateCommand(); //
thisCommand.CommandText="SELECT * FROM Intro";
OleDbDataReader thisReader=thisCommand.ExecuteReader();
while(thisReader.Read())
{
Console.WriteLine("\t{0}\t{1}",thisReader["ID"],thisReader["TheName"]);
}
thisReader.Close();
thisConnection.Close();
}
}
}