i have a datetime column in sql server and its optional field and if the user decided not to enter then i want to insert the value as NULL in the table and i define somethin
You need DBNull.Value rather than null when inserting into SQL server.
DBNull.Value
null
When you set DateTime = null in .NET it takes the minimum value of DateTime which is 01-01-0001.
DateTime = null
DateTime
I'd assume you are using a SMALLDATETIME in SQL Server where the minimum value is '01/01/1900'
SMALLDATETIME