

Deployment Tools Foundation
ExecuteQuery Method (sqlFormat, args)
Deployment Tools Foundation Namespaces ► Microsoft.Deployment.WindowsInstaller ► Database ► ExecuteQuery(String, array<Object>[]()[][])
Executes the specified SQL SELECT query and returns all results.

C# | Visual Basic | Visual C++ | F# |
public IList ExecuteQuery( string sqlFormat, params Object[] args )
Public Function ExecuteQuery ( sqlFormat As String, ParamArray args As Object() ) As IList
public: IList^ ExecuteQuery( String^ sqlFormat, ... array<Object^>^ args )
member ExecuteQuery : sqlFormat : string * args : Object[] -> IList

IList
All results combined into an array
All results combined into an array

The sqlFormat parameter is formatted using Format(String, array<Object>[]()[][]).
Multiple rows columns will be collapsed into a single one-dimensional list.
Win32 MSI APIs: MsiDatabaseOpenView, MsiViewExecute, MsiViewFetch

Exception | Condition |
---|---|
BadQuerySyntaxException | the SQL syntax is invalid |
InstallerException | the View could not be executed |
InvalidHandleException | the Database handle is invalid |
Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.11.1.2318)