none
Object of type 'System.String' cannot be converted to type 'System.DateTime'.

    Question

  • I have a stored procedure which has two parameters of DateTime type startDate, endDate.
    I added new Dataset i.e GetEmployee and while trying to refresh fields, it asked for values for two parameters startDate, endDate. I added "01/05/2006", and "01/01/2007" but got this error "Object of type 'System.String' cannot be converted to type 'System.DateTime'."
    I went to parameter and checked the DataType of each parameter, both were Date/Time.

    Does anyone know how to fix this?

    creativity..
    Tuesday, August 04, 2009 8:37 PM

Answers

  • Try leaving the default values for the parameters blank. and then run the report. That should revel which datatype the report is expecting for the parameters. If that doesn't expose anything useful, just remove the parameters and make sure your dataset is accepting the variables in the stored proc, prompts you for input values when you execute the stored proc within the dataset and then re-apply them on the report as input paramenters.


    Garth H MCTS: SQL 2008 BI http://bitinkering.spaces.live.com/
    Tuesday, August 04, 2009 10:20 PM

All replies

  • Are you entering the quotation marks.  You can just enter the value(s) without quotes.


    David Dye
    Tuesday, August 04, 2009 8:44 PM
  • nope.

    startDate 1/1/2006
    endDate  1/2/2007

    creativity..
    Tuesday, August 04, 2009 8:45 PM
  • Try leaving the default values for the parameters blank. and then run the report. That should revel which datatype the report is expecting for the parameters. If that doesn't expose anything useful, just remove the parameters and make sure your dataset is accepting the variables in the stored proc, prompts you for input values when you execute the stored proc within the dataset and then re-apply them on the report as input paramenters.


    Garth H MCTS: SQL 2008 BI http://bitinkering.spaces.live.com/
    Tuesday, August 04, 2009 10:20 PM