Results 1 to 4 of 4

Thread: out-of-range datetime value

  1. #1
    Join Date
    Jul 2009
    Posts
    52

    out-of-range datetime value

    Hello,
    I am writing web application. It was working fine with no errors in my local server and the live server. My system lost its data and the hard drive got corrupted. So my hard drive was replaced with a new one. When I configure the web application on my new hard drive and run it, it was working ok except for the part that is has date selection on it I get the following error
    Exception Type: System.Data.SqlClient.SqlException.

    I have not change the code or anything; the same version is working on the live server with no issues. I don’t know why it is giving me this error in my machine?? Any Suggestion??

  2. #2
    Join Date
    May 2008
    Posts
    4,345

    Re: out-of-range datetime value

    first of all Check your database properties. check for changes has been made wrongly.Pull the date is char versus datetime. Check your regional settings. For example, if you're trying to pass a date in UK format and the server is trying to interpret it in US format, you will either see this error or the wrong date in your database.Check for locale mismatch between the front end and back end. This typically happens if you have the front end (the Web server) and the back end (the data server) running on entirely separate machines.

  3. #3
    Join Date
    May 2008
    Posts
    3,316

    Re: out-of-range datetime value

    check your local setting .May be the locale settings for the server may be wrong. When you configure Windows Server (and in turn SQL Server) for a specific locale, the formatting of dates and times are inherited automatically from those settings. If the locale settings don't match the data being passed to the server -- for instance, if dates are passed as MM/DD/YYYY when they should be DD/MM/YYYY -- then the error will result. It can also happen if you're trying to import data from a source where the date formatting clashes with your locale settings.

  4. #4
    Join Date
    May 2008
    Posts
    4,570

    Re: out-of-range datetime value

    This problems arise every time, You have to Create SqlParameter objects for the parameters.And after that add them to the Parameters collecion of the command.The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +260. Check for your local setting and make them correct.

Similar Threads

  1. Datetime Perl module not installing
    By Wampanoag in forum Software Development
    Replies: 6
    Last Post: 19-06-2010, 12:31 AM
  2. How to convert string into DateTime
    By Segvoia in forum Software Development
    Replies: 7
    Last Post: 05-03-2010, 02:55 PM
  3. Compare two DateTime objects
    By teena_pansare in forum Software Development
    Replies: 3
    Last Post: 28-11-2009, 05:38 PM
  4. DateTime Format String
    By Zool in forum Software Development
    Replies: 3
    Last Post: 17-07-2009, 03:20 PM
  5. SQL SELECT with DateTime
    By Coldman in forum Software Development
    Replies: 5
    Last Post: 26-02-2009, 02:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,567,018.95568 seconds with 16 queries