Home All Groups Group Topic Archive Search About
Author
1 Apr 2006 2:31 AM
DK
In the UI, there are some optional field but in the DB I want tto store NULL
instead of empty string. Do I check for empty string for these values in the
business layer when I am going thru each row in the datatable for Data
Validation.
Thanks

Author
1 Apr 2006 8:23 AM
Miha Markic [MVP C#]
Empty string isn't a null value.
Yes, I guess (unless your UI controls can store null value) you would have
to resort to "manual" replacament of empty strings to DBNull.Value values.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"DK" <D*@discussions.microsoft.com> wrote in message
news:DA744B2C-6B3F-4F67-9335-C363D088B954@microsoft.com...
> In the UI, there are some optional field but in the DB I want tto store
> NULL
> instead of empty string. Do I check for empty string for these values in
> the
> business layer when I am going thru each row in the datatable for Data
> Validation.
> Thanks
Author
1 Apr 2006 12:06 PM
Cor Ligthert [MVP]
DK,

This is a way you can do this in the databindingevents.

http://www.vb-tips.com/default.aspx?ID=c4832a2a-2b95-4ded-93d9-4deb7fa4a0b8

I hope this helps,

Cor

Show quote
"DK" <D*@discussions.microsoft.com> schreef in bericht
news:DA744B2C-6B3F-4F67-9335-C363D088B954@microsoft.com...
> In the UI, there are some optional field but in the DB I want tto store
> NULL
> instead of empty string. Do I check for empty string for these values in
> the
> business layer when I am going thru each row in the datatable for Data
> Validation.
> Thanks

AddThis Social Bookmark Button