Exemplo n.º 1
0
        public bool ExecuteScalarBoolean(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;
            bool result = DatabaseConverter.ToBoolean(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Exemplo n.º 2
0
        public bool ExecuteDataTableBoolean(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

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