![Copy image Copy image](copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Deployment Tools Foundation
Database Property
Gets the Database for the install session.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ |
public Database Database { get; }
Public ReadOnly Property Database As Database Get
public: property Database^ Database { Database^ get (); }
![](collapse_all.gif)
![](collapse_all.gif)
Normally there is no need to close this Database object. The same object can be used throughout the lifetime of the Session, and it will be closed when the Session is closed.
Win32 MSI API: MsiGetActiveDatabase
![](collapse_all.gif)
Exception | Condition |
---|---|
InvalidHandleException | the Session handle is invalid |
InstallerException | the Database cannot be accessed |
Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.9.1006.0)