Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

Update: I found that the issue with similar solution is already discussed in “Setting NullValue property for typed dataset”  blog

In generated Typed Datasets attempt to access field with DBNull value by default throw an exception. It is usually  not convinient, and I prefer to change nullValue annotation to _null,  as it was suggested here

However I didn't find a way to change the default(Anyone knows???).

I have to open each column in desigher and change the  nullValue to _null.

Alternatively I have to open .XSD file in XML editor (rigth mouse click,“open with...“,”XML editor” - no XML Vew tab in VS 2005 as it was in VS 2003) and insert ="_null" to each column.

msprop:nullValue

You cah try global replace

type="xs:string"    to

msprop:nullValue="_null" type="xs:string" 

Note, that you can NOT assign _null to simple types, like int or bool.


It is not very convinient process.

Related request in MS Connect:Allow Null Values to be returned from strongly typed datasets .

Posted on Thursday, March 2, 2006 9:23 AM .Net Framework , Visual Studio/TFS/git | Back to top


Comments on this post: Change NullValue behavior for generated Typed Datasets in Visual Studio 2005.

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net