ExecuteStringQuery Method (sql, record)

DTF API

Copy image CopyHover image
Deployment Tools Foundation ExecuteStringQuery Method (sql, record)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerDatabaseExecuteStringQuery(String, Record)
Executes the specified SQL SELECT query and returns all results as strings.
Declaration Syntax
C# Visual Basic Visual C++ F#
public IList<string> ExecuteStringQuery(
	string sql,
	Record record
)
Public Function ExecuteStringQuery ( 
	sql As String,
	record As Record
) As IList(Of String)
public:
IList<String^>^ ExecuteStringQuery(
	String^ sql, 
	Record^ record
)
member ExecuteStringQuery : 
        sql : string * 
        record : Record -> IList<string> 
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
IList<(Of <(<'String>)>)>
All results combined into an array
Remarks

Multiple rows columns will be collapsed into a single on-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.dll) Version: 3.0.0.0 (3.11.1.2318)