C# And Ms Access Database Tutorial #3 – 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.
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.
In data source section “Microsoft Access Database File (OLE DB)” is selected by default.
If “Microsoft Access Database File (OLE DB)” is not selected by default click change and select it from the list, then click Okay.
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.
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.
If You want to get database connection string and other database properties go to “Advanced”.
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.