TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sandeep kumar
NA
8
0
how to Save Timepan in sqlserver 2008 using Asp.net 3.5
Aug 17 2010 12:47 PM
hello everybody,
I am getting time span paramter from our client apllication(in Asp.net 3.5 using C#).
When i am Saving this Timepan Parameter at Our Backend (Sql server 2008) Using Linq(In WCF Service) it gives following error:
Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'.
My Code is given below:
objsession.s_QuestionMasterTopicInsert(topic.Title, contentId,
Convert.ToDateTime(Time), topic.IsAvailable, ref strRet, ref strRetMsg);
// Time(is the time span type )
//I changed Convert.ToDateTime(Time) to new DateTime(time.Ticks),
objsession.s_QuestionMasterTopicInsert(topic.Title, contentId, new DateTime(time.Ticks), topic.IsAvailable, ref strRet, ref strRetMsg);
But it gives following error:
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
Is it Possible to convert timespan to Datetime?
How should I save timespan at My backend as Datetime Field ?
Reply
Answers (
0
)
convert datagrid data to csv file?
query about dummy and live website