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

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
 
W

William Ryan

SELECT IsNull(myColumn1, 0), IsNull(myColumn2, 0), IsNull
(myStringColumn, '') from myTable
 
A

Anton Sommer

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
 
A

ann

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
 
A

Anton Sommer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top