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