<% group # Abstract accessors %> <% order # 20 %>

The following example demonstrates how to create and use an abstract data accessor class. All abstract methods of the class are generated at run-time depending on each method declaration. Every part of the method declaration is important. Method's return value specifies one of the Execute methods in the following way:
Return TypeExecute Method
IDataReader interfaceExecuteReader
Subclass of DataSetExecuteDataSet
Subclass of DataTableExecuteDataTable
Class implementing the IList interfaceExecuteList or ExecuteScalarList
Class implementing the IDictionary interfaceExecuteDictionary or ExecuteScalarDictionary
voidExecuteNonQuery
string, byte[] or value typeExecuteScalar
In any other caseExecuteObject
Method name explicitly defines action name which is converted to stored procedure name.
Type, sequential order, and name of the method parameters is mapped to the command parameters. Exceptions from this rule are:

AbstractAccessor.cs <% ..\..\..\HowTo\DataAccess\AbstractAccessor.cs %> Person.cs <% ..\..\..\HowTo\DataAccess\Person.cs %> Gender.cs <% ..\..\..\HowTo\DataAccess\Gender.cs %> App.config <% Doc\Data\App.config %> Create.sql script