This is a migrated thread and some comments may be shown as answers.

String was not recognized as a valid TimeSpan.

2 Answers 384 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
pmourfield
Top achievements
Rank 1
pmourfield asked on 04 Oct 2011, 01:46 PM
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 Answers, 1 is accepted

Sort by
0
pmourfield
Top achievements
Rank 1
answered on 04 Oct 2011, 03:13 PM
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.
0
ihsojsakiv
Top achievements
Rank 2
answered on 20 Jun 2013, 07:11 AM
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
Tags
General Discussions
Asked by
pmourfield
Top achievements
Rank 1
Answers by
pmourfield
Top achievements
Rank 1
ihsojsakiv
Top achievements
Rank 2
Share this question
or