PC Review


Reply
Thread Tools Rate Thread

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

 
 
Anton Sommer
Guest
Posts: n/a
 
      26th Aug 2003
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


 
Reply With Quote
 
 
 
 
William Ryan
Guest
Posts: n/a
 
      26th Aug 2003
SELECT IsNull(myColumn1, 0), IsNull(myColumn2, 0), IsNull
(myStringColumn, '') from myTable


>-----Original Message-----
>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
>
>
>.
>

 
Reply With Quote
 
Anton Sommer
Guest
Posts: n/a
 
      26th Aug 2003
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


 
Reply With Quote
 
Morgan
Guest
Posts: n/a
 
      26th Aug 2003
Have a look at the .Parse and .Format events.


"Anton Sommer" <anton.schamy_no_spam_@arcor.de> wrote in message
news:bie21h$12c$01$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
ann
Guest
Posts: n/a
 
      26th Aug 2003
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

>-----Original Message-----
>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
>
>
>.
>

 
Reply With Quote
 
Anton Sommer
Guest
Posts: n/a
 
      27th Aug 2003
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
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
null value in xml translates to empty string in dataset after ReadXML BillE Microsoft ADO .NET 1 25th Apr 2008 11:48 PM
update query avoiding null values =?Utf-8?B?RW1tZXR0IEwu?= Microsoft Access Queries 2 13th Jul 2007 05:02 PM
Empty text values aren't null or zero-length, but 2-byte null (\x0000) Mark Steward Microsoft Access 2 21st Jan 2006 03:03 PM
Avoiding Null Values using nz() won't work with Access ODBC driver =?Utf-8?B?Um9i?= Microsoft Access Queries 2 12th Mar 2004 07:01 PM
Avoiding Null values and using 0 instead Frank M. Microsoft Access Queries 2 15th Dec 2003 12:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 AM.