TimeSpan/Duration 2 SQL Server

  • Thread starter Thread starter Zürcher See
  • Start date Start date
Z

Zürcher See

I was wondering if was possible to have a dataadapter load a TimeSpan
(called 'duration' in a DataSet) from a SQL Server, but because the TimeSpan
stuct doen't implement the IConvertible interface and the SQL Server hasn't
an TimeSpan/Duration field I think is not possible. Or am I wrong?

Thank's Züri
 
Züri,

What I would do is load it into a datetime, and then use the TimeOfDay
property to get the timespan. It's much easier to just store it as a date
offset, and then convert that from a datetime to the timespan.

Hope this helps.
 
Back
Top