I have an SQL querySELECT SUM(DATALENGTH(Data)) FROM FooBar
where 'Data' is an 'image' field.I am calling this query from .Net code, aka SqlCommand command = new SqlCommand(@"SELECT SUM(DATALENGTH(Data)) FROM FooBar", connection);object result = command.ExecuteScalar();
I would like to know the expected .Net type of "result". Sometimes I get an 'int' and sometimes I get an other type causing cast exception if I do int myValue = (int)result
Do anyone knows what is the expected .Net type returned by SUM ?Thanks in advance,Joannes