Change NullValue behavior for generated Typed Datasets in Visual Studio 2005.

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 @ Thursday, March 02, 2006 9:23 AM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 1 and 4 and type the answer here:
 

Live Comment Preview:

 
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910