Summary

In this chapter we covered the basics of databases, as well as the easiest ways of creating Visual Basic.NET applications to display and manipulate data stored in SQL Server. One of the key points to remember is that correct database construction can have a significant impact on the overall performance and usability of an application. Normalization, referential integrity, and indexing can be very beneficial when applied. However, too much indexing can actually create more work for the database, offsetting the benefit provided. As you go through the next few chapters and consider the business cases presented, keep these points in mind.

Questions and Answers

Q1:

In VB6 I built quick data prototypes using the data control. Is there a data control in VS.NET?

A1:

No. All the functionality of the data control from VB6 and previous has been factored into the various data objects that we discussed in this chapter. For example, the ability of a data control to connect to a database is now handled by the SqlConnection object. The data control's ability to retrieve, update, and delete records is managed by the BindingContext object in conjunction with the DataAdapter object. Navigating from one object to the next is the responsibility of the BindingContext object, and so on. Unlike the old data controls, none of these objects have any visual representation at run time, which works to your advantage, enabling you to build whichever kind of data-driven user interface you want.

Q2:

Is it possible to have a primary key comprise more than one field?

A2:

Yes. Although not often done, in the database environment, it is known as a concatenated key. For example, you might use such a key if you know that all the people in your database are going to have a unique combination of first and last names. You choose to make the FirstName and LastName fields the concatenated primary key so that users can never enter the same name twice in the database.



Database Access with Visual Basic. NET
Database Access with Visual Basic .NET (3rd Edition)
ISBN: 0672323435
EAN: 2147483647
Year: 2003
Pages: 97

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