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