Chapter 6: Working with the DataSet

Microsoft Exam Objectives Covered In This Chapter:

  • Create and manipulate DataSets.

    • Manipulate a DataSet schema.

    • Manipulate DataSet relationships.

    • Create a strongly typed DataSet.

Chapter 5, “Working with the .NET Data Providers,” covered some of the classes found in the System.Data namespace that work in a connected fashion with the database—primarily the Connection, Command, and DataReader classes. This chapter covers the ADO.NET objects that work in a disconnected fashion, taking data from the database and enabling a client to work with it locally and to submit updates at a later time. You will still be using Connection and Command objects to initially retrieve data from the database and to finally submit changes, but you have some new objects to consider, starting with the DataAdapter and DataSet, that manage data after it is sent to the client.

This chapter introduces you to the DataAdapter and DataSet objects, as well as other classes in the System.Data namespace including the DataView, DataColumn, DataRelation, and Constraint classes. The DataView object provides customized views of the tables in the DataSet by using Sort, Filter, and Find operations. The DataColumn object describes the type and size of data to be stored in each column in a table and is important for determining the structure of a DataTable. DataRelation and Constraint objects define data integrity rules for the DataSet, to mirror those conditions that have been set in the database itself.

This chapter also includes an example of how to use Visual Studio .NET components to add ADO.NET objects, such as the Connection, Command, and DataSet objects, to your application simply by dragging and dropping them from the Toolbox. Visual Studio .NET will then automatically generate the code to instantiate and configure those objects. You can also ask Visual Studio .NET to generate a strongly typed DataSet, which is an extension of the basic DataSet object. The strongly typed DataSet defines the data structure in advance, and enforces that structure by using XML Schema definition language (XSD) and by creating a class in your application to supply custom properties and methods based on the data definition.

Note 

Additional methods of the DataSet that provide easy reading and writing of XML data are covered in Chapter 7, “Working with XML Data.”



MCAD/MCSD(c) Visual Basic. NET XML Web Services and Server Components Study Guide
MCAD/MCSD: Visual Basic .NET XML Web Services and Server Components Study Guide
ISBN: 0782141935
EAN: 2147483647
Year: 2005
Pages: 153

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