avoiding Null Values in dataset.table and set them to empty string or 0

  • Thread starter Thread starter Anton Sommer
  • Start date Start date
A

Anton Sommer

Hello folks,

is there a way how I can avoid Null Values in datasets when they are filled
with a dataadapter. (Of cours I could change my querey so that no Null
values are returned, but I can't do so in my case). I have tryed to set
nillable property to false and set a default value, but then all lines
contain the default value even those where data is returned from the query.

So, how can I change all null values to emty string or 0?

Thank you very much


Anton
 
SELECT IsNull(myColumn1, 0), IsNull(myColumn2, 0), IsNull
(myStringColumn, '') from myTable
 
Thanks Ryan,

but I wanted it to be done clientside not on sql server, e.g. doing
someting to the dataset or just converting.


Any other Suggestions from anybody?


Thanks

Anton
 
If you use typed dataset, when you define dataset through
XSD file, you can specify the NULL value . Or you can
derive a sub class from dataset and put the default logic
there.

Ann
 
Thank ann

I use typed datasets but where can I set a null value because setting a
default value of the column surprisingly sets all rows to the default value
even when the DataAdapter fills values for that row.

Thank you
 
Back
Top