iBATIS.NET Class Library DataMapper V1.6.1, DataAccess V1.9.1

IMappedStatement.ExecuteQueryForDictionary Method (ISqlMapSession, Object, String, String)

Executes the SQL and retuns all rows selected in a map that is keyed on the property named in the keyProperty parameter. The value at each key will be the value of the property specified in the valueProperty parameter. If valueProperty is null, the entire result object will be entered.

[Visual Basic]
Function ExecuteQueryForDictionary( _
   ByVal ISqlMapSession As ISqlMapSession, _
   ByVal Object As Object, _
   ByVal String As String, _
   ByVal String As String _
) As IDictionary{``0,``1}
[C#]
IDictionary<K,V> <K,V>ExecuteQueryForDictionary(
   ISqlMapSession session,
   Object parameterObject,
   String keyProperty,
   String valueProperty
);

Parameters

session
The session used to execute the statement
parameterObject
The object used to set the parameters in the SQL.
keyProperty
The property of the result object to be used as the key.
valueProperty
The property of the result object to be used as the value (or null)

Return Value

A IDictionary of object containing the rows keyed by keyProperty.

Exceptions

Exception Type Condition
DataMapperException If a transaction is not in progress, or the database throws an exception.

See Also

IMappedStatement Interface | IBatisNet.DataMapper.MappedStatements Namespace | IMappedStatement.ExecuteQueryForDictionary Overload List