Hi mnd701,
Why do you get null in the StartDate ?
I tried the following code and it just works fine, shows the length as 19.
public DateTime StartTime
{
get;
set;
}
private void button4_Click(object sender, EventArgs e)
{
MessageBox.Show("StartTimeLen = " + StartTime.ToString().Length);
}
Just StartTime property is made and on a button click I display this message box, It shows me "19" as its length.
I think its not the issue that StartDate is null or doesn't have a value - by default DateTime has its min value for its each field.
As pointed by Phillipe Mori, the SQL has a low range of Date & Time and the date you get in C# doesn't fit the range of SQL & that's why you are facing error.
I recommend debug your app by displaying StartDate before passing to SQL. If you still can't make out, provide the full error message to help you better.
Thanks