Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:08:26+00:00 2026-05-27T11:08:26+00:00

I am having an application in .NET 3.5 and SQL Server 2005. There are

  • 0

I am having an application in .NET 3.5 and SQL Server 2005.

There are lot of instances in my application where user is asked for date. There I found an error that whenever a user enters a date less than 01/01/1753 it gives the following error:

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and
12/31/9999 11:59:59 PM.

When, I drill down the error, I found that .NET supports dates from 01/01/0001 to 12/31/9999 whereas SQL Server 2005 supports date range of 01/01/1753 to 12/31/9999.

Now I need to have check in my application for min date.

But the problem is that I have to implement it at lot of instances, so finding some better solution.

Can anyone tell me the other way round to handle this date issue.

Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:08:27+00:00Added an answer on May 27, 2026 at 11:08 am

    Perhaps this might help you to get a valid SQL DateTime easy

    public static class Extensions
    {
        public static DateTime AsSqlValue(this DateTime date)
        {
            if(date < SqlDateTime.MinValue.Value)
                return SqlDateTime.MinValue.Value;
            return date;
        }
    }
    

    Usage

    MyDateTime.AsSqlValue();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using vb.net and sql server 2000 for developing my application....The problem i'm having
I have C#.Net winform application having SQL Server Database in SQLExpress with Windows Authentication.
Having a weird problem. I'm testing an ASP.NET application I wrote that queries SQL
I am running ASP.NET application written in C# and using SQL Server 2005. I
I'm having trouble deploying an ASP.Net application using Sql Server CE 4.0. I get
We have a .NET e-commerce application with a SQL Server 2005 back-end. A new
I'm having a really frustrating error trying to secure an ASP.NET application using the
I'm having trouble loading JQueryUI from Google's CDN. I've got an ASP.NET application that
I'm having a problem with an ASP.NET MVC application that I'm developing. I'm still
My organization currently delivers a web application primarily based on a SQL Server 2005/2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.