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

ISqlMapper.QueryForDictionary Method (String, Object, String, String)

Alias to QueryForMap, .NET spirit. Feature idea by Ted Husted.

[Visual Basic]
Function QueryForDictionary( _
   ByVal String As String, _
   ByVal Object As Object, _
   ByVal String As String, _
   ByVal String As String _
) As IDictionary
[C#]
IDictionary QueryForDictionary(
   String statementName,
   Object parameterObject,
   String keyProperty,
   String valueProperty
);

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)

Return Value

A IDictionary (Hashtable) 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

ISqlMapper Interface | IBatisNet.DataMapper Namespace | ISqlMapper.QueryForDictionary Overload List