读取Access数据库 [英] Reading Access database
本文介绍了读取Access数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从MS Access表中读取数据并将其存储到变量中?
How can I read data from MS Access table and store them into variables?
推荐答案
要从Access database
读取和写入数据,Typed DataSet
功能可以使用.使用类型化的数据集时,每个Table
和Row
都会创建一个strongly typed class
,以便可以像properties
一样访问Table
的列,而无需将列名硬编码为字符串.
在此处 http://msdn.microsoft.com/zh-cn/library/ms171897(v = vs.80).aspx [用于从DataBase和使用反射将DataTable保存到数据库中 [
To read and write data fromAccess database
theTyped DataSet
feature can be used. With typed dataset astrongly typed class
is made for eachTable
andRow
so that the columns of theTable
can be accessed likeproperties
without hard coding the Column names as strings.
AWalkthrough on Creating a Dataset with the Dataset Designer
is given here http://msdn.microsoft.com/en-us/library/ms171897(v=vs.80).aspx[^] in whichAccess version of Northwind
sample database can be used as stated in theNote
on that article.
After creation of typed data set, to fill and save each data tablecorresponding TableAdapter
has to be used due tostrongly typed
nature of theDataTable
. However, in this CodeProject article
General purpose class to fill DataTable(s) from DataBase and to save DataTable(s) to DataBase using reflection[^]
a general purpose class is given to read data from database and write data to databasefor all tables of the database
usingType DataSet
.An example with MS Accesss database
is also given in the article.
I think it may be helpful.
在Google上搜索"c#访问数据库教程",您将获得大约200万个结果.
这是其中之一:
http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/ReaddatafromAccessdatabase.htm [ ^ ]
瓦莱里.
Hi,
Search on Google for "c# access database tutorial", you''ll get about 2 million results.
Here is one of them:
http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/ReaddatafromAccessdatabase.htm[^]
Valery.
这篇关于读取Access数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文