Sunday, February 19, 2012

Inserting NULL values on Date Fields trhough DAL

I am using a DAL and i want to insert a new row where one of the columns is DATE and itcanbe 'NULL'.

I am assigning SqlTypes.SqlDateTime.Null.

But when the date is saved in the database, i get the minvalue (1/01/1900) . Is there a way to put the NULL value in the database using DAL??

how can i put an empty date in the database?

THANK YOU!!!

check ifthishelps.|||

That does not work. Besides, in your example you are NOT using DAL. You are inserting directly to the DB, through a SQL statement.

Thannks,

JeffKish

|||

The code in the link below uses ADO.NET parameters. Hope this helps.

http://www.c-sharpcorner.com/Code/2003/Sept/EnterNullValuesForDateTime.asp

No comments:

Post a Comment