October 10th, 2013, 10:08 AM
How Do You Add a Null in a DateTime Field?
Good morning everybody.
I'm trying to add a null into a SQL Server DateTime column called ShippedDate. With the below code I get an error message that says "Nullable object must have a value". This is driving me crazy. How do I do this?
private void InsertHeader(Guid inG)
DateTime now = DateTime.Now;
string po = txtPoNumber.Text;
string cn = ddlCustomer.Text;
DateTime? shippeddate = null;
OrderHeaderBll.Insert(inG, now, calStartDate.SelectedDate, po, cn, shippeddate.Value);
October 10th, 2013, 10:22 AM
Re: How Do You Add a Null in a DateTime Field?
Never mind guys. I found the solution. Thanks for looking.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!