首页 > 数据库技术 > 详细

c#读access数据库

时间:2015-04-22 11:00:08      阅读:226      评论:0      收藏:0      [点我收藏+]

using System;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Text;

class Program
{
static void Main(string[] args)
{
OleDbConnection thisConnection = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\cinda_dafen_simple.mdb");
thisConnection.Open();
OleDbCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = "SELECT * FROM 采购项目招标信息表";
OleDbDataReader thisReader = thisCommand.ExecuteReader();
while (thisReader.Read())
{
Console.WriteLine("\t{0}\t{1}", thisReader[0], thisReader[1]);
}

while (thisReader.Read())
{
DataRow row = thisReader.Read();
foreach(row.)
}


thisReader.Close();
thisConnection.Close();
Console.WriteLine("数据库读取完成!");
Console.ReadLine();
}
}

 

c#读access数据库

原文:http://www.cnblogs.com/vivicai/p/4446634.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!