Question sqldatetime.null display 1/1/1900

jamie123

Well-known member
Joined
May 30, 2008
Messages
82
Programming Experience
Beginner
I'm trying to use sqldatetime.null to put in a null value for my datetime field in my table, but whenever I use it, it puts in the value 1/1/1900..i guess that's the value for datetime null in a sqlserver? If this is so, how would I just enter a blank value into a datetime field? I want nothing to show up at all. Is this possible? The field is nullable

Thanks!
 
FinancialTableAdapter.Insert(Form1.intPID, DateTimePicker1.Value, cboDesc.Text, txtCPT.Text, txtMOD1.Text, txtMOD2.Text, txtPay.Text, txtFee.Text, Balance, False, False, "", Form1.strDoctor, SqlDateTime.Null, 0)

When I execute this and view the entry through the datagrid, the date shows up as "1/1/1900"
 
In Tools..Options..Debugging take the tick away from "Just My Code" and step into the Insert() command. At the point where the insert is made (ExecuteNonQuery() )

What value (using the LOCALS window) does the relevant parameter have at that time?

Open a query analyzer window in SQLServer Management Studio and select the relevant record. Is it really null in the DB or is it 1900? We need to determine where it's null and where it is converting
 

Latest posts

Back
Top