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

SqlMapper.QueryForDictionary Method (String, Object, String, String, DictionaryRowDelegate<K,V>)

Runs a query with a custom object that gets a chance to deal with each row as it is processed.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.
[Visual Basic]
NotOverridable Overloads Public Function QueryForDictionary( _
   ByVal String As String, _
   ByVal Object As Object, _
   ByVal String As String, _
   ByVal String As String, _
   ByVal DictionaryRowDelegate<K,V> As DictionaryRowDelegate{``0,``1} _
) As IDictionary{``0,``1} _
    Implements ISqlMapper.
[C#]
public IDictionary<K,V> <K,V>QueryForDictionary(
   String statementName,
   Object parameterObject,
   String keyProperty,
   String valueProperty,
   DictionaryRowDelegate<K,V> rowDelegate
);

Parameters

statementName
The name of the sql statement to execute.
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)
rowDelegate
A delegate called once per row in the QueryForDictionary method>

Return Value

A IDictionary (Hashtable) of object containing the rows keyed by keyProperty.

Implements

ISqlMapper.

Exceptions

Exception TypeCondition
DataMapperExceptionIf a transaction is not in progress, or the database throws an exception.

See Also

SqlMapper Class | IBatisNet.DataMapper Namespace | SqlMapper.QueryForDictionary Overload List