简体   繁体   中英

Connecting to access database using code

I am a student How to connect to access database using code ( not using wizard) and retrive values in the textbox in c# using visual studio 2008.

I have to extract 3 fields from the access database.

Do anybody know. Pl help.

OleDbConnection is the standard class to query an Access database. Here's an example .

Start by reading up on ADO.NET and then use the OleDb Data Provider. Once you have the values it should be trivial to put them into a text box.

Here is a good ADO.NET tutorial:

And some good OLEDB info:

In addition: Get the "Visual C# 2010 Samples" from

http://code.msdn.microsoft.com/cs2010samples/Wiki/View.aspx?title=Home

and look at the

"OLEDB: Demonstrates how to use a Microsoft Access database from C# by creating a dataset and adding tables to it."

sample.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM