Error in my aspx Page [Conversion failed when converting datetime from character string] RRS feed

  • Question

  • I want to Display 7Day News Description Display in Aspx Page In respective Column Like Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday.

    to Fetch Data From Database Table.   

    This is my Query     

       string sql = "select Name, datename(dw,EventDate)DayName,Description, CONVERT(VARCHAR(10),EventDate,111)Date from [event] WHERE EventDate >='#" + from.Date.ToShortDateString ()  + "#' AND EventDate <='#" + to.Date.ToShortDateString ()  + "#'";

    resolve it.

    Tuesday, May 3, 2011 5:18 AM

All replies

  • Hello saqib123456,


    Welcome to the MSND Forum.

    Accoeding to your description, I'm afraid I don't understand you well. I have some questions. If you have any time, could you please make me clear?

    • What's the schema of your table in DataBase?
    • What do you want the result looks like?
    • In you sql statement, what does the "#" stand for?

    I am looking forward to hearing from you.


    Have a ncie day,

    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 5, 2011 9:59 AM