Database Reference
In-Depth Information
Our emphasis in this topic is explaining how C# works with ADO.NET by showing you how to code
fundamental operations. If you can code them yourself, you'll have insight into what C# does when it
generates things for you, as in the next chapter on using Windows Forms. This is invaluable for
understanding how to configure generated components and debugging applications that use them.
Although you can code an .xsd file yourself (or export an XSL schema for an untyped data set with
System.Data.DataSet.WriteXmlSchema() and modify it) and then use the xsd.exe utility to create a class
for a typed data set, it's a lot of work, is subject to error, and is something you'll rarely (if ever) want or
need to do.
Summary
In this chapter, we covered the basics of data sets and data adapters. A data set is a relational
representation of data that has a collection of data tables, and each data table has collections of data
rows and data columns. A data adapter is an object that controls how data is loaded into a data set (or
data table) and how changes to the data set data are propagated back to the data source.
We presented basic techniques for filling and accessing data sets, demonstrated how to filter and
sort data tables, and noted that though data sets are database-independent objects, disconnected
operation isn't the default mode.
We discussed how to propagate data modifications back to databases with parameterized SQL and
the data adapter's UpdateCommand , InsertCommand , and DeleteCommand properties, and how command
builders simplify this for single-table updates.
We briefly mentioned the important issue of concurrency and then introduced XML, the
fundamental technology behind ADO.NET.
Finally, we discussed typed and untyped data sets.
Now that you've seen, understood, and practiced ADO.NET with Windows applications, in the next
chapter we'll explore using data control with ASP.NET applications.
 
Search WWH ::




Custom Search