HELP! how can I connect to MSACCESS...

france

Member
Joined
Feb 17, 2005
Messages
17
Location
CA
Programming Experience
1-3
Hello.. I have a project that is due in a few weeks time and I cant even connect to my database yet :'(

Ive read about connecting to databases.. from what Ive read I need datasets, dataadapters ,dataconnections and datagrids so I can display and manipulate my tables during run-time. however I dont know how to connect.. I find it very confusing.. because all books Ive read is using SQL as an example not MSACCESS..

Can someone plssssss help me on this? I would really appreciate this.. thank u..
 
ADO.NET is designed in such a way that the different types of databases are access in very similar manners. SQL uses the System.Data.SqlClient namespace whereas Access uses the System.Data.OleDb namespace. If you have samples for SQL, just replace the different classes in the SqlClient namespace with the OleDb namespace equivalent (for eample, the System.Data.SqlClient.SqlDataAdapter becomes a System.Data.OleDb.OleDbDataAdapter). The connection strings will also vary for the different types of dataBases. See www.connectionStrings.com for some examples.

I always suggest using the DataForm Wizard to generate a sample form. You can then view the code and see how it's done.
To use the DataForm Wizard, right click on your project in the solution explorer, click Add -> 'Add New Item'; in the dialog select 'Data Form Wizard' and answer the questions given by the Wizard.
 
Back
Top