SQLDateTime Overflow error (ASP.Net 2.0 with SQL Server 2005)

R

Randy Smith

Hi ALL,
I've got some date fields that will end up being null, but I can set it to
some other date. However, I tried setting the fields to "01/01/1900", and I
get the same error on that as well. Can someone tell me what I'm doing
wrong? I've tried a bunch of different combinations, but nothing I do seems
to make any difference. I even tried casting it to a DateTime, but got a
compile error (cannot convert type "string" to 'System.DateTime')..
TIA, Randy

if (js.StartDate != null)

{

cm.Parameters.AddWithValue("@startDate", js.StartDate);

}

else

{

cm.Parameters.AddWithValue("@startDate", "01/01/1900");

}
 

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

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top