Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-10-2009
Member
 
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??
Reply With Quote
  #2  
Old 09-10-2009
Member
 
Join Date: May 2008
Posts: 4,339
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.
Reply With Quote
  #3  
Old 09-10-2009
Member
 
Join Date: May 2008
Posts: 3,313
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.
Reply With Quote
  #4  
Old 09-10-2009
Member
 
Join Date: May 2008
Posts: 4,565
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "out-of-range datetime value"
Thread Thread Starter Forum Replies Last Post
Datetime Perl module not installing Wampanoag Software Development 6 19-06-2010 12:31 AM
How to convert string into DateTime Segvoia Software Development 7 05-03-2010 02:55 PM
Compare two DateTime objects teena_pansare Software Development 3 28-11-2009 05:38 PM
DateTime Format String Zool Software Development 3 17-07-2009 03:20 PM
SQL SELECT with DateTime Coldman Software Development 5 26-02-2009 02:36 PM


All times are GMT +5.5. The time now is 11:44 AM.