Executes the specified select statement against SimpleDB using default options and returns only the first attribute value in the result set.

Namespace: Simol
Assembly: Simol (in Simol.dll) Version: 1.0.0.0

Syntax

C#
public Object SelectScalar<T>(
	string selectStatement,
	params CommandParameter[] selectParams
)
Visual Basic
Public Function SelectScalar(Of T) ( _
	selectStatement As String, _
	ParamArray selectParams As CommandParameter() _
) As Object
Visual C++
public:
generic<typename T>
virtual Object^ SelectScalar(
	String^ selectStatement, 
	... array<CommandParameter^>^ selectParams
) sealed

Parameters

selectStatement
Type: System..::..String
The select statement to execute.
selectParams
Type: array<Simol..::..CommandParameter>[]()[][]
The select parameter values.

Type Parameters

T

Return Value

The first attribute of the first item in the result set or null if there are no results.

Implements

ISimol..::..SelectScalar<(Of <<'(T>)>>)(String, array<CommandParameter>[]()[][])

Remarks

This method supports use of the SimpleDB "count" keyword. For example: select count(*) from MyDomain

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionIf the selectStatement parameter is null
System..::..ArgumentOutOfRangeExceptionIf the selectStatement parameter is empty
AmazonSimpleDBExceptionIf the request to SimpleDB fails for any reason
Simol..::..SimolDataExceptionIf the SimpleDB item cannot be converted into the requested item type
Simol..::..SimolConfigurationExceptionIf no valid SimpleDB mapping can be configured for the requested item type

See Also