Showing posts with label data access. Show all posts
Showing posts with label data access. Show all posts

Friday, October 12, 2007

Sample Codes: Data Access (2)

This sample improves the previous one by delegating all data access functions to a separate class named DBHelper. This also implements row filtering using the DefaultView property of a DataTable.

Download Code

This sample uses an MS Access database for persistent storage and adds reporting capabilities. This uses a different approach to retrieving and updating data by extending the DataSet class.

Download Code

To run both applications, set the ConnectionString value of the App.config file to the correct path of the databases. For the second example, Crystal Studio should be installed.

Thursday, September 20, 2007

Sample Code and Slide: Data Access

This sample uses the SQL provider to retrieve and manipulate data in an attached database (SQLExpress). This also demonstrates binding data to DataGridView and ComboBox controls.

To run the application, edit the AttachDbFilename value in the App.config file to point to the correct path of the database file. You can also copy the mdf/ldf files to a fixed location, e.g. "C:\", and set your AttachDbFilename value to "C:\Purchasing.mdf"

Download Code
Download Powerpoint Presentation