There are several ways to load data into your business objects.
Method 1 - LoadByPrimaryKey
- Automatically generated for you in your business object.
- Calls the "Get" version stored procedure (i.e. daab_GetEmployees).
- All the columns contained in the table's primary key become parameters to the function. You must specify a value for all fields in the primary key in order to return one row.
Method 2 - LoadAll
- Automatically generated for you in your business object.
- Calls the "GetAll" version stored procedure (i.e. daab_GetAllEmployees).
- Returns all rows in the database table.
Method 3 - Dynamic Queries
- Used to create custom queries. (see the Dynamic Query tutorial)
- Queries are created in code without writing SQL (which is not portable across databases).
Method 4 - LoadFromSql
- Used in your concrete classes to call custom queries.
- Can be used with both stored procedures and inline SQL.
Method 5 - QuerySource
- Used in conjunction with dynamic queries to load the business object from an alternate data source, such as a view.
- If the alternate data source is a superset of the columns defined in the business object, you can still Save the business object.
Method 6 - LoadFromSqlNoExec
- Used to call a custom query without affecting the business object's contents.
- Can be used with both stored procedures and inline SQL.
Method 7 - LoadFromSqlScalar
- Used to return a value from a custom query without affecting the business object's contents.
- Can be used with both stored procedures and inline SQL.
Method 8 - LoadFromSqlReader
- Used to return an IDataReader from a custom query without affecting the business object's contents.
- Can be used with both stored procedures and inline SQL.