Beispiel #1
0
        /// <summary>
        /// Instantiate a new Session.
        /// </summary>
        /// <param name="database">The database to open.</param>
        public Session(Database database)
        {
            string packagePath = String.Format(CultureInfo.InvariantCulture, "#{0}", (uint)database.Handle);

            uint handle = 0;
            int  error  = MsiInterop.MsiOpenPackage(packagePath, out handle);

            if (0 != error)
            {
                throw new MsiException(error);
            }
            this.Handle = handle;
        }