Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

AdoTemplate.QueryForObject(CommandType, String, IRowMapper) Method

Execute a query with the specified command text, mapping a single result row to an object via a RowMapper.

[Visual Basic]
Public NotOverridable Overloads Sub QueryForObject( _
   ByVal cmdType As CommandType, _
   ByVal cmdText As String, _
   ByVal rowMapper As IRowMapper _
) _
    Implements IAdoOperations.QueryForObject
[C#]
public object QueryForObject(
   CommandType cmdType,
   string cmdText,
   IRowMapper rowMapper
);

Parameters

cmdType
The command type.
cmdText
The command text to execute.
rowMapper
object that will map one object per row

Return Value

The single mapped object.

Implements

IAdoOperations.QueryForObject

Exceptions

Exception Type Condition
IncorrectResultSizeDataAccessException If the query does not return exactly one row.
DataAccessException If there is any problem executing the query.

See Also

AdoTemplate Class | Spring.Data.Core Namespace | AdoTemplate.QueryForObject Overload List