August 2003
Intermediate to advanced
736 pages
14h 48m
English
In addition to potential problems in creating and relating the various data objects, another source of much coding, and therefore potential for error, is in the access to columns. By default, columns are named with a string and then cast to the specific type that is expected:
string postalCode = (string)dataset.Tables["Customers"].Rows[0]["PostalCode"];
If you get it wrong, the best thing that can happen is an exception at run time; the worst is a silent failure that hides the error. It would be useful if we could make the compiler help figure out when there are errors so that we can find and correct them before we even run the code. That's the job of the typed data set.
To create a typed data set, ...
Read now
Unlock full access