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 4005560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:24:30+00:00 2026-05-20T08:24:30+00:00

I have written a small Asp.net application using Entity Framework. A Stored Procedure accepts

  • 0

I have written a small Asp.net application using Entity Framework.

A Stored Procedure accepts the following:
employeeID int, startDate varchar(12),endDate varchar(12)

I then use SQL server to convert the short date strings to DateTime.

SET @correctStartDate = CONVERT(DATETIME,(convert(varchar(10),@startDate,103) + ' 00:00:00am'), 103)
SET @correctEndDate = CONVERT(DATETIME,(convert(varchar(10),@endDate,103) + ' 11:59:59pm'), 103)

In development environment iis7 Windows Server 2008 with SQL Server 2008 R2 there are no issues.

If we deploy to production server iis6 (Windows Server 2003 SP2 with SQL Server 2008 R2) we get:

“The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.”

Why would this be? Both have regional settings the same.

  • 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-20T08:24:31+00:00Added an answer on May 20, 2026 at 8:24 am

    The problem was what Martin said. The language settings have a login context.

    To solve the issue I have inserted the datetime into the stored procedure instead of the datetime.ToShortDateString() method.

    You could also use myDatetime.ToString(“dd/MM/yyyy”);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In an ASP.NET application, I have a small number of fairly complex, frequently used
I have written a small java application for which I need to obtain performance
I have a small AJAX application, written in PHP that I did not secure
I have written some code in my VB.NET application to send an HTML e-mail
I have an ASP.Net application running under IIS 6. A simple page has two
I have written a small program using Borland's C++ builder, and along the way,
an application I have written uses several third party jars. Sometimes only a small
I have a website written in Classic ASP and ASP.NET, after a few redirects
I have written a small perl application for deployment on a few servers. It
I have written a small Perl script and now I would like to create

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.