Solved

How to pass in sql server's datetime default value which is 1/1/1900 from .NET code. It is possible to do System.Date.SqlTypes.SqlDateTime.DefaultValue?

Posted on 2008-06-12
3
1,967 Views
Last Modified: 2013-12-17
How to pass in sql server's datetime default value which is 1/1/1900 from .NET code. It is possible to do System.Date.SqlTypes.SqlDateTime.DefaultValue?

I was able to do System.Date.SqlTypes.SqlDateTime.MinValue to get the minimum value.

Thanks in advance

Chale
0
Comment
Question by:chaleastale
  • 2
3 Comments
 
LVL 19

Expert Comment

by:elimesika
Comment Utility
HI

you can use

DateTime.MinValue
0
 

Author Comment

by:chaleastale
Comment Utility
Thanks for the reply. If you pass in empty string for a DateTime column, sql server will insert 1/1/1900 as a default value. I want to pass in this default value from .NET. For a certain reason, I can't passing in empty string.

I only need this default value. Not the minimum date
0
 
LVL 19

Accepted Solution

by:
elimesika earned 125 total points
Comment Utility
You can still pass a dateime object that has this value


DateTime d = new DateTime(1900,1,1);
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now