I am trying to calculate the timespan between to sql datetime fields, Bdc_TimeIn (datetime) and Bdc_TimeOut. I need to store the timespan in a third field called Bdc_TimeElapsed which is currently of Data Type time.
I have tried TimeSpan telapsed = Bdc_TimeOut.Subtract(Bdc_TimeIn); but I get the error:
CS1061 'DateTime?' does not contain a definition for 'Subtract' and no accessible extension method 'Subtract' accepting a first argument of type 'DateTime?' could be found (are you missing a using directive or an assembly reference?)
- How can I calculate the Timespan between Bdc_TimeIn and Bdc_TimeOut
- How can I store the result in my MSSql Database.
Thanks for any help...Very new to this type of data manipulation.