ExecuteScalar Method (sql, record)

Microsoft Deployment Compression & Installer

Copy image CopyHover image
Deployment Tools Foundation ExecuteScalar Method (sql, record)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerDatabaseExecuteScalar(String, Record)
Executes the specified SQL SELECT query and returns a single result.
Declaration Syntax
C# Visual Basic Visual C++
public Object ExecuteScalar(
	string sql,
	Record record
)
Public Function ExecuteScalar ( 
	sql As String,
	record As Record
) As Object
public:
Object^ ExecuteScalar(
	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
Object
First field of the first result
Remarks
Exceptions
Exception Condition
BadQuerySyntaxException the SQL syntax is invalid
InstallerException the View could not be executed or the query returned 0 results
InvalidHandleException the Database handle is invalid

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.9.1006.0)