Exemple #1
0
        public Guid ExecuteScalarGuid(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;

            Guid result = DatabaseConverter.ToGuid(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Exemple #2
0
        public Guid ExecuteDataTableGuid(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

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