Connecting Tech Pros Worldwide Forums | Help | Site Map

NULL Value

BD
Guest
 
Posts: n/a
#1: Oct 29 '07
Developing C# app using VS 05 to connect to remote SQL Server 05. One
form has a textbox bound to datetime column. When I delete the date
in the textbox, app locks. I was using Access 2003 to hit the
database and this did not cause a problem. Therefore, I know it can
be done but have been unable to accomplish. Have been successful in
checking for an empty string but cannot get NULL back into database
column. Any help greatly appreciated.

BD


Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#2: Oct 29 '07

re: NULL Value


BD,

Have you tried using DBNull.Value for a null value? Most of the data
providers will recognize this as null.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"BD" <bwaldrum@charter.netwrote in message
news:1193678316.049248.316820@o80g2000hse.googlegr oups.com...
Quote:
Developing C# app using VS 05 to connect to remote SQL Server 05. One
form has a textbox bound to datetime column. When I delete the date
in the textbox, app locks. I was using Access 2003 to hit the
database and this did not cause a problem. Therefore, I know it can
be done but have been unable to accomplish. Have been successful in
checking for an empty string but cannot get NULL back into database
column. Any help greatly appreciated.
>
BD
>

Brendon Bezuidenhout
Guest
 
Posts: n/a
#3: Oct 29 '07

re: NULL Value


DBNull not working?
http://msdn2.microsoft.com/en-us/lib...ll(VS.90).aspx

"BD" <bwaldrum@charter.netwrote in message
news:1193678316.049248.316820@o80g2000hse.googlegr oups.com...
Quote:
Developing C# app using VS 05 to connect to remote SQL Server 05. One
form has a textbox bound to datetime column. When I delete the date
in the textbox, app locks. I was using Access 2003 to hit the
database and this did not cause a problem. Therefore, I know it can
be done but have been unable to accomplish. Have been successful in
checking for an empty string but cannot get NULL back into database
column. Any help greatly appreciated.
>
BD
>
BD
Guest
 
Posts: n/a
#4: Oct 29 '07

re: NULL Value


On Oct 29, 12:36 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Quote:
BD,
>
Have you tried using DBNull.Value for a null value? Most of the data
providers will recognize this as null.
>
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
>
"BD" <bwald...@charter.netwrote in message
>
news:1193678316.049248.316820@o80g2000hse.googlegr oups.com...
>
Quote:
Developing C# app using VS 05 to connect to remote SQL Server 05. One
form has a textbox bound to datetime column. When I delete the date
in the textbox, app locks. I was using Access 2003 to hit the
database and this did not cause a problem. Therefore, I know it can
be done but have been unable to accomplish. Have been successful in
checking for an empty string but cannot get NULL back into database
column. Any help greatly appreciated.
>
Quote:
BD
I have tried it, but have been unable to get it to work. My C# skills
are lacking. I have been trying to do in this in the text changed
method but I think it should be done in validating event instead. I
have turned off the validating events in the designer. I am trying to
code it with and IF ELSE statement, think it should be a Try Catch
Block instead.

Closed Thread