Posts
1150
Comments
891
Trackbacks
1
C#: My Strongly-Typed DataSet is throwing StrongTypingException exceptions

This typically happens when you create a typed dataset from a database that allows null values.

For reasons not clear to me (my normal guess is “user error” but dragging and dropping tables to the DataSet designer does this), the default setting for each column's NullValue is “(Throw Exception)”, so your strongly-typed dataset is doing what you are 'telling' it to do.  (For values that aren't of Data Type System.String, you can't change this, for other reasons not clear to me).

For System.String type columns, you can change this NullValue to either be (Empty) or (Null).

For other column types, I do 'evil' things like using try-catch blocks, although it looks like you could use partial classes and modify the following and get something to work:

http://www.codecomments.com/archive321-2005-11-685304.html

posted on Wednesday, September 20, 2006 2:01 PM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 6 and 2 and type the answer here: