C Sharp And Ms Access Database Tutorial 3 How To Add Ms Access Database To Visual Studio 2010 accdb file

C# And Ms Access Database Tutorial #3 – How To Add Ms Access Database To Visual Studio 2010 (.accdb file)

How To Add Ms Access Database To Visual Studio 2010 (.accdb file)

This Tutorial Shows How To Add Microsoft Access Database(.accdb file) To Visual Studio 2010.
If you don’t have a project, First Create it.
In This case am creating c# windows forms application.
Open Visual Studio 2010. Or any other version.
Go To File menu.
Then new.
Choose Project.
Choose C#.
Under C# Choose Windows.
On the next pane choose Windows forms application.
Give Your Project a Name.
Choose a location in your computer where you want to save the project. Or leave the default location selected.
Then Click Okay.
Set Windows Start Position to Center Screen. This Enables your windows application to start in the middle of the screen.

How To Add Ms Access Database To Visual Studio 2010 (.accdb file)

On tools menu, Select Connect To Database.

How To Add Ms Access Database To Visual Studio 2010 accdb file - Tools Connect To Database
How To Add Ms Access Database To Visual Studio 2010 accdb file – Tools Connect To Database


In data source section “Microsoft Access Database File (OLE DB)” is selected by default.

How To Add Ms Access Database To Visual Studio 2010 accdb file - Choose Data Source
How To Add Ms Access Database To Visual Studio 2010 accdb file – Choose Data Source

If “Microsoft Access Database File (OLE DB)” is not selected by default click change and select it from the list, then click Okay.

How To Add Ms Access Database To Visual Studio 2010 accdb file - Change Data Source
How To Add Ms Access Database To Visual Studio 2010 accdb file – Change Data Source


Browse the file name. This is the location where your database is stored. i.e. – (C:\Users\Authentic\Documents\MicrosoftAccessDatabase.accdb).
Choose Browse next to Database file name, and then navigate to your .accdb file and choose Open.

How To Add Ms Access Database To Visual Studio 2010 accdb file - Choose Database File
How To Add Ms Access Database To Visual Studio 2010 accdb file – Choose Database File
How To Add Ms Access Database To Visual Studio 2010 accdb file - Browse And Choose Database accdb File
How To Add Ms Access Database To Visual Studio 2010 accdb file – Browse And Choose Database accdb File

After Choosing The File Name Is Displayed In TextBox.


Click Test Connection To Test Connection to the database.
If the connection is successful click Ok on the message box.

How To Add Ms Access Database To Visual Studio 2010 accdb file - Test Connection
How To Add Ms Access Database To Visual Studio 2010 accdb file – Test Connection


If You want to get database connection string and other database properties go to “Advanced”.

How To Add Ms Access Database To Visual Studio 2010 accdb file - Connection String
How To Add Ms Access Database To Visual Studio 2010 accdb file – Connection String


This is the connection string you will use programmatically to connect to ms access database.
Now go to server explorer window and you will see the newly added database.

How To Add Ms Access Database To Visual Studio 2010 accdb file - Database Added To Server Explorer
How To Add Ms Access Database To Visual Studio 2010 accdb file – Database Added To Server Explorer

Leave a Reply

Your email address will not be published. Required fields are marked *