This sample demonstrates how to use a Microsoft Access database from C#. It shows how you can create a dataset and add tables to it from a database. The BugTypes.mdb database used in the sample program is a Microsoft Access 2000 .mdb file.
Security Note |
---|
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended. |
To build and run the OLE DB sample within Visual Studio
On the Debug menu, click Start Without Debugging.
Note If you are building the solution in Release mode, copy BugTypes.mdb into the \bin\release folder.
To build and run the OLE DB sample from the Command Line
Type the following at the command prompt:
csc oledbsample.cs oledbsample