Insert Null Date

G

Guest

How do I insert a null date into sql 2000? I tried this:

DateTime expireDate = (txtExpDate.Text.Trim().Length <= 0) ?
DateTime.MinValue : DateTime.Parse(txtExpDate.Text);

and

DateTime expireDate = (txtExpDate.Text.Trim().Length <= 0) ? null :
DateTime.Parse(txtExpDate.Text);

it doesn't accept nulls for DateTime, and the MinValue is not null.
Can anyone help please?
 
G

Guest

I guess that's not possible...what you have to do is if the date text box
field is null than set the date as '1/1/1900' and compare the date in Sql
Server if the value is same enter null value, otherwise the actual value.

Raj
 

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