Thursday, October 29, 2009

Summary











 < Day Day Up > 





Summary



As you've seen in the past two chapters, disconnected data can open your system design to an entirely new set of possibilities. However, there are some aspects of working with disconnected data and the DataSet class that aren't obvious. This chapter addressed several of these issues, including reading and writing binary data, associating related tables with the DataRelation class for easier and more efficient navigation, and handling concurrency issues with multiuser, disconnected data systems. The chapter began by illustrating how to use the DataReader class to read binary data. As DataReader only provides a means of reading data, the section then illustrated how to manually set up SqlCommand and SqlParameter objects to write binary data to a database. By way of comparison, the DataSet class was then used to both read and write the same binary data. The section then concluded with a demo maintenance application that employed the DataSet class to load data from a provided sample table containing a photo column and data.



In the next section, you discovered how the DataRelation class gives you the ability to define relationships between related tables so that both tables can be navigated more easily and efficiently. Using this class, you can download two related tables, specify which columns create the parent/child linkage between the tables, and then, when in possession of a row from one of the tables, use either the GetParentRow or GetChildRows methods to retrieve the related rows from the other table. The section wrapped up by showing how to use stored procedures with return parameters to solve the issue of inserting parent rows that contain an auto-increment primary key so that the value of that key can be retrieved and used in inserting the child rows.



Finally, the chapter ended with a section on concurrency. This section explained what concurrency is, the various levels supported with ADO. NET, and roles played by the data adapter and command builder classes. After a demo application was presented to illustrate an example of a concurrency conflict, the section presented several techniques for handling concurrency conflicts in a graceful manner.



In Chapter 5, you learned a good deal about XML, and in the past two chapters, you've been exposed to quite a bit of ADO.NET. This is definitely not by chance, as Microsoft sees XML and ADO.NET as two of the cornerstone technologies for the future of .NET and data access in general. Therefore, in the next chapter, we'll bring all this full circle with a complete chapter on combining ADO.NET and XML.













     < Day Day Up > 



    No comments: