13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

......The root node can have up to three children. The first is the DataSetobject with its current contents, <strong>in</strong>clud<strong>in</strong>g newly added rows and modified rows but notdeleted rows. The actual name of this subtree depends on the DataSetName propertyof the source DataSet object. If the DataSet object has no name, the subtree's root isNewDataSet.The subtree rooted <strong>in</strong> the node conta<strong>in</strong>s enough <strong>in</strong><strong>for</strong>mation to restorethe orig<strong>in</strong>al state of all modified rows. For example, it still conta<strong>in</strong>s any row that hasbeen deleted as well as the orig<strong>in</strong>al contents of any modified row. All columns affectedby any change are tracked <strong>in</strong> the subtree.The last subtree is , which conta<strong>in</strong>s <strong>in</strong><strong>for</strong>mation about any errors thathave occurred <strong>in</strong> a particular row. The DataRow class provides a few methods andproperties that programmers can use to set an error on any column <strong>in</strong> the row. Errorscan be set at any time, not necessarily when the data is entered. For example, <strong>in</strong>distributed applications, it's typical <strong>for</strong> one user to create some data that another userhas to validate. In this situation, the reviewer can set an error message on each columnof a row to signal that someth<strong>in</strong>g is wrong with that column. Amaz<strong>in</strong>gly, the <strong>Microsoft</strong>W<strong>in</strong>dows Forms DataGrid control then detects any pend<strong>in</strong>g errors on displayed rowsand marks them with a red exclamation po<strong>in</strong>t, provid<strong>in</strong>g the user with visual feedbackthat a particular column conta<strong>in</strong>s an error.The follow<strong>in</strong>g list<strong>in</strong>g shows a sample DiffGram <strong>in</strong> which row 1 has been modified, row 2has been deleted, row 3 has an error, and a new row has been added:362

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!