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,977 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Expert Comment

by:elimesika
ID: 21770654
HI

you can use

DateTime.MinValue
0
 

Author Comment

by:chaleastale
ID: 21770709
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
ID: 21770825
You can still pass a dateime object that has this value


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

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

624 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