Returns first object from the query result.
Data is retrieved by executing SQL statements.
For information on the SQL syntax supported, see the SQL document "Eloquera SQL Reference",
Throws an exception if the SQL statement fails to execute.
| C# | Visual Basic | Visual C++ |
public Object ExecuteScalar( string query, Parameters parameters )
Public Function ExecuteScalar ( _ query As String, _ parameters As Parameters _ ) As Object
public: Object^ ExecuteScalar( String^ query, Parameters^ parameters )
- query (String)
- Query to execute
- parameters (Parameters)
- Parameters for the query
The object corresponding to the requested query.
If the query returns multiple objects, only the first one will be returned.
If the query results in the empty set, null is returned.
Parameters param = db.CreateParameters(); param["manual"] = "Operation Manual"; Book book = (Book)db.ExecuteScalar("SELECT Book WHERE title = @manual", param);