Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
1,979 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
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 375 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

885 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