We now have a fully functional AddressBook program that we can use to store, manage and search our contacts. During this tutorial we have learnt what objects are used to retrieve the data using the OleDbDataAdapter and OleDbDataReader objects and the objects used to manage the data via the use of the OleDbCommand object. We have also learnt how we can filter data without having to re-query the database each time, and did this by using the DataView object.
This project could be improved in numerous ways. The first most obvious improvement is to provide the user with the ability to add and edit all fields in the Contacts table. Another improvement would be to introduce some exception handling routines to the code (which I left out intentionally for space reasons) in order to gracefully handle any exceptions that may occur.
Whether you decide to finish the project to make it more complete or move onto your next killer app, the information in this article will have hopefully given you an introduction to and understanding of working with databases using ADO.NET.
In Part three, which will be published later this year, I will use an SQL Server database and show you how to use Stored Procedures to access and modify the data. The user interface and functionality will remain the same, only the database used will change.