Workshop


Quiz

1.

What is the name of the data access namespace used in the .NET Framework?

2.

What is the name given to a collection of DataRows?

3.

How do I get data into and out of a DataTable?

4.

What object is used to connect to a data source?

5.

What argument of a connection string contains information about the type of data being connected to?

6.

What object provides update, delete, and insert capabilities to a DataAdapter?

7.

What method of a DataTable object do you call to create a new row?

Answers

1.

System.Data.

2.

A DataSet.

3.

You use a DataAdapter.

4.

There are multiple connection objects. You have to use the connection object appropriate for the type of data you are accessing.

5.

The Provider argument.

6.

A CommandBuilder object.

7.

The Add() method is used to create the row. The Update() method saves your changes to the new row.

Exercises

1.

Create a new project that connects to the same database used in this example. Rather than displaying a single record in two text boxes, put a list box on the form and fill the list box with the names of the people in the database.

2.

Right now, your code will save an empty name to the database. Add code to the Click event of the Add button so that it first tests to see if the user entered a contact name. If not, tell the user a name is required and then exit the procedure.




Sams Teach Yourself Microsoft Visual C# 2005 in 24 Hours, Complete Starter Kit
Sams Teach Yourself Visual C# 2005 in 24 Hours, Complete Starter Kit
ISBN: 0672327406
EAN: 2147483647
Year: N/A
Pages: 248
Authors: James Foxall

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