Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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,978 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 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

705 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