As mentioned in the comments, you need to use square brackets to enclose your column names, not single quotes:
SELECT CONVERT(TIME, DATEADD(s, SUM((DATEPART(hh, [E-Run Time]) * 3600 ) + (DATEPART(mi, [E-Run Time]) * 60 ) + DATEPART(ss, [E-Run Time])), 0))FROM dbo.Table1
As it stands, you query is currently trying to convert the literal string
"E-Run Time"
to a
datetime
value, which obviously won't work.
Your query converts the result to a
TIME
value, but your C# code tries to read it as a
DateTime
value. That won't work; you need to read it as a
TimeSpan
instead.
Date/Time Data Types and Parameters[
^]
Also, you should consider giving your columns better names. Avoid spaces, stick to Latin characters and numbers -
A..Z
and
0..9
- and make sure the names start with a letter. That way, you won't need to wrap the names in square brackets before you can use them.