Hour 21. Working with a Database

   

Hour 21. Working with a Database

You've heard it so many times that it's almost a clich : This is the information age. Information is data, and managing information means working with databases. Database design is a skill unto itself, and entire books are devoted to database design and management. In this hour, you'll learn the basics of working with a database using ADO.NET, Microsoft's newest database technology. Although high-end solutions are built around advanced database technologies such as Microsoft's SQL Server, the Microsoft Jet database (used by Microsoft Access) is more readily available and easier to learn, so you'll build working examples that use a Jet database.

The highlights of this hour include the following:

  • Introduction to ADO.NET

  • Connecting to a database

  • Understanding DataTables

  • Creating a DataAdapter

  • Referencing fields in a DataRow

  • Navigating records

  • Adding, editing, and deleting records

  • Building an ADO.NET example

graphics/bookpencil.gif

You'll learn a lot in this hour, but realize that this material is really the tip of the iceberg. Database programming can be, and often is, very complex. This hour is intended to get you writing database code as quickly as possible, but if you plan on doing a lot of database programming, you'll want to consult a dedicated book (or two) on the subject.

Start by creating a new Windows Application named Database Example. Change the name of the default form to fclsMain and set its Text property to Database Example. Next, click the View Code button on the Solution Explorer window to access the form's code, scroll down and locate the procedure Main(), and change the reference of Form1 to fclsMain. Finally, click the Form1.cs tab to return to the form designer.


   
Top


Sams Teach Yourself C# in 24 Hours
Sams Teach Yourself Visual Basic 2010 in 24 Hours Complete Starter Kit (Sams Teach Yourself -- Hours)
ISBN: 0672331136
EAN: 2147483647
Year: 2002
Pages: 253
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net