String was not recognized as a valid TimeSpan.

3 posts, 0 answers
  1. pmourfield
    pmourfield avatar
    32 posts
    Member since:
    Aug 2011

    Posted 04 Oct 2011 Link to this post

    Good morning everyone. I am trying to use a RadTimePicker to insert a time into a database column with data type of time(7). However, when I try to do this, I get the following error "String was not recognized as a valid TimeSpan." Any ideas?
  2. pmourfield
    pmourfield avatar
    32 posts
    Member since:
    Aug 2011

    Posted 04 Oct 2011 Link to this post

    I have found the answer. In the parameters for the sql data source I was using DbType="Time". I switched this from "Time" to "String" type and everything is inserting fine.
  3. ihsojsakiv
    ihsojsakiv avatar
    1 posts
    Member since:
    May 2012

    Posted 20 Jun 2013 Link to this post

    Hey I am using Sqlserver 2008 R2 and using  time(7) to store time format.

    its working proper in my apps. try to use it.

    Attendance.EarlyIn = Convert.ToDateTime(CheckInTime.Duration().ToString()).TimeOfDay;

    Cheers
    Vikas Joshi
    Software Engineer
Back to Top