Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public int ExecuteDataTableInteger(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? 0 : DatabaseConverter.ToInteger(dataTable.Rows[0][0]));
        }