How to Connect to an Access Database in Microsoft Visual C# (C Sharp)
Member
By Derek Hardenbergh, eHow Member
Article Rating: (2 Ratings)
* Email
* Facebook
* Twitter
* StumbleUpon
* Add to Favorites
* Print
* Share
I want to do this! What's This?
Connect to an Access Database in Microsoft Visual C# (C Sharp)
How to Connect to an Access Database in Microsoft Visual C# (C Sharp)
Connect to a local Access database and display a table in a form in Microsoft Visual C# (C Sharp).
Difficulty: Moderate
Instructions
Things You'll Need:
* Microsoft Visual C# 2008 Express (free)
* Microsoft Access 2000 or 2003
* Northwind Sample Access Database
1. Step 1
Note: This article assumes you have installed Microsoft Visual C# 2008 Express Edition. You may download it for free from here: http://www.microsoft.com/express/download/
If you need the Northwind sample database, there is a version here: http://www.microsoft.com/downloadS/details.aspx?FamilyID=c6661372-8dbe-422b-8676-c632d66c529c&displaylang=en
Open Microsoft Visual C#. Click on "Project..." to the right of Create in the Recent Projects area of the Start Page.
The New Project window will open. Click on "Windows Forms Application", enter a Name, and click OK.
By default, the only form in the project will be called "Form1" and you will be in Design mode for that form.
On the toolbar, select Data->Add New Data Source...
2. Step 2
The Data Source Configuration Wizard window will pop-up. Select Database and then click Next.
Click New Connection.
3. Step 3
The Add Connection window will pop-up. Click the Change button.
The Change Data Source window will pop-up. Select Microsoft Access Database File. Then click OK.
4. Step 4
You will be back to the Add Connection window. Now click the Browse button.
Navigate to the location of the Northwind.mdb file. Mine was located here: C:\Program...