Friday, March 9, 2012

HELP! cant figure this one out!

I'm in desperate need of help. I'm setting up an intranet portal using DNN. I added an event calendar module, but whenever I try to add events to it, the system rejects it with a nasty Sql exception saying the conversion from char to datetime produced an out of bounds result.

The string the table uses to convert to datetime is (I have not modified it, the module is exactly as it came when i downloaded)

(convert(varchar,getdate(),101))

The whole stack trace for the error is:

Stack Trace:

[SqlException: La conversin del tipo de datos char a datetime produjo un valor datetime fuera de intervalo.]
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +642
System.Data.SqlClient.SqlCommand.ExecuteReader() +11
DotNetNuke.AVCalendarDB.Save() +1067
DotNetNuke.AVCalendarEdit.updateButton_Click(Objec t sender, EventArgs e) +3367
System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1263

At first I thought it could be a language issue (DNN and the module are in english and my system runs XP Pro in Spanish) but I discarded it since it didn't work when I installed XP Pro in english

Any ideas?? I would really appreciate your help
Best regards from Chile
Javier L.What is this?

[SqlException: La conversin del tipo de datos char a datetime produjo un valor datetime fuera de intervalo.]|||Originally posted by gyuan
What is this?

[SqlException: La conversin del tipo de datos char a datetime produjo un valor datetime fuera de intervalo.]

The conversion from char to datetime produced a value outside the range of a datetime.

This is caused when you have a string value that cannot possibly be date ( 31 Feb 2004) or a time 66:00:00. You need to check the data is coherent.|||Put VARCHAR(10) instead of just VARCHAR. But I don't think this is the line that it's barking at...|||Did you try this on your Query Analyzer?

select convert(varchar(20), getdate(), 101)|||Based on the error message you got

The conversion from char to datetime produced a value outside the range of a datetime.

the problem is not in the code

convert(varchar(20),getdate(),101)

No comments:

Post a Comment