Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Unanswered: HELP! can't 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 conversión 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.

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    What is this?

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

  3. #3
    Join Date
    Nov 2003
    Posts
    94
    Originally posted by gyuan
    What is this?

    [SqlException: La conversión 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.

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Put VARCHAR(10) instead of just VARCHAR. But I don't think this is the line that it's barking at...

  5. #5
    Join Date
    Dec 2003
    Posts
    454
    Did you try this on your Query Analyzer?

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

  6. #6
    Join Date
    Dec 2003
    Posts
    454
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •