Null Value exception thrown, need to change default action

Migrating a legacy Access VB6 app to VS 2005 B2, the old app handles null's read from ADO recordsets in its own way.

The migrated code using a dataset is suffering from exceptions that the generated dataset code throws. I need to be able to reset the default action to either ignore or replace etc. This is an option for the field in the dataset (codegen etc).

However I would like to do it once for the entire dataset (30+ tables of 20 columns and n assorted queries etc). Doing this by hand for each field is a real pain.

Is there a way to change the default null handling option from throw exception to anything else, when initially generating the typed dataset.

Thanks

[682 byte] By [AndyP] at [2007-12-16]
# 1

Hi AndyP,

When you design your typed dataset, you can specify the behavior for null values by modifing columns 'NullValue' property: Empty, Null and Throw exception (default).

You would open .XSD, in mode text, associated to your typed dataset and you replace all 'Throw exception' by 'Null'.

Good Coding!

Javier Luna
http://guydotnetxmlwebservices.blogspot.com/

JavierLuna at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified