public decimal ExecuteScalarDecimal(IDbCommand command) { if (AutoOpenClose) { Open(); } command.Connection = SqlConnection; command.CommandTimeout = CommandTimeout; decimal result = DatabaseConverter.ToDecimal(command.ExecuteScalar()); if (AutoOpenClose) { Close(); } return(result); }
public decimal ExecuteDataTableDecimal(IDbCommand command) { DataTable dataTable = ExecuteDataTable(command); return(!HasRows(dataTable) ? 0 : DatabaseConverter.ToDecimal(dataTable.Rows[0][0])); }