Click here to Skip to main content
15,920,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

When i run the application on my local machine, i find no errors, but when i deploy the same code in server and try to do transaction find the following error.


Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Thu, 28 Apr 2011 12:14:05 UTC

Message: Sys.WebForms.PageRequestManagerServerErrorException: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Line: 4723
Char: 21
Code: 0
URI: http://localhost/Sandisk/ScriptResource.axd?d=uKUKt_JaLfkTXtx-oZugZsHyOGzwdaUG_e3Jka6qDmH1_VtVDz-q6e6akKYDnZ5EsIUwi4RqguNZEIe5yei_D1_WMu-BZkWN0GJSYTH1Eus213dbmEzDIkoSAhQ2ZPegatYK3JYkVeSn5_5if8wUCbsnSQoqUap-ps8tTjcJP6585oBi0&t=ffffffff9c2081d3

I am using ASP.Net and coding in C#.net.
Frame work 3.5
If any one knows the solution please help me out.


Thanks
Shiv
Posted
Comments
Monjurul Habib 28-Apr-11 18:24pm    
share your code to help you.

Without seeing your code it's very hard to tell, but I have a feeling that it's problem with the locale settings on the server - it's trying to convert what is essentially a string (varchar) to a date object. You'll get those kinds of errors when you try to parse a date with 13 or more months, 32 or more days, more than 24 hours, that kind of thing.
 
Share this answer
 
As per the Error ,
it seems there are mainly 2 possibilites this error could arise.
1.) If you are doing any operation (INSERT/UPDATE) and using a SP/INLINE code please check the parameters passed in SP or INLINE CODE.

2.)The Operations you are carrying please check the table schema and datatype for the particular problem.

Hope this helps.
Is possible can you attach code so that it will be easy to rectify.
And one more thing do check the culture on your local machine and one where you are deploying the application
 
Share this answer
 
v2
1. You are probably using incorrect datatypes. Why do you need to convert date to varchar or vice versa?
2. To me it seems a locale issue. In your settings, date format may be dd/mm/yy whilst on the server it may be mm/dd/yy. So, 13/01/11 will work on your computer but may not work on the deployed version.

This is why choice of correct datatypes is very important. Try to remove the conversion from your application to be safe.
 
Share this answer
 
Are u using calendar control with default attached textbox.
try to check with default date of your calendar to your database.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900