hi, I have a method (see below)
public T ExecuteScalar<T>(string sSql, params SqlParameter[] parameters)
{
if (!string.IsNullOrEmpty(sSql))
{
DataAccess dal = new DataAccess(ConnectionString);
DebugOutput_SQL(sSql, parameters);
object value = null;
value = dal.ExecuteScalar(sSql, parameters);
if (value != null && value != DBNull.Value)
return (T)value;
}
return default(T);
}
and I call this
int32 WorkFlowID = DataProvider.ExecuteScalar<Int32>(sSql);
then it give me a error "Don't unbox to value" in line "return (T)value", any suggestion for this.