ExecuteQuery Method (sql, record)

Microsoft Deployment Tools

Deployment Tools Foundation ExecuteQuery Method (sql, record)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerDatabaseExecuteQuery(String, Record)
Executes the specified SQL SELECT query and returns all results.
Declaration Syntax
C# Visual Basic Visual C++
public IList ExecuteQuery(
	string sql,
	Record record
)
Public Function ExecuteQuery ( _
	sql As String, _
	record As Record _
) As IList
public:
IList^ ExecuteQuery(
	String^ sql, 
	Record^ record
)
Parameters
sql (String)
SQL SELECT query string
record (Record)
Optional Record object containing the values that replace the parameter tokens (?) in the SQL query.
Return Value
All results combined into an array
Remarks

Multiple rows columns will be collapsed into a single one-dimensional list.

Win32 MSI APIs: MsiDatabaseOpenView, MsiViewExecute, MsiViewFetch

Exceptions
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) Version: 3.0.0.0 (3.5.1623.0)