> 2)       When returning multiple items, does an iList have to be
> used?

Yes. Do you anticipate this being a problem? There are many objects in
the framework that extend IList. ArrayList is the first one that comes
to mind.

> Can you dynamically receive the data and data types from the
> database?

IBatisNet simply calls through to interfaces in the System.Data
namespace: IDbCommand, IDbConnection, IDbParameter, etc. Whatever you
can do when them, you can do with IBatisNet.

> 3)       What is the best practice for filling datagrids and
> datalists
> with data returned from the datamapper?

You could bind the IList returned from QueryForList directly to the
DataSource property:

 dg.DataSource = sqlMap.QueryForList("GetAll", null);
 dg.DataBind();

A better way would be to create domain objects and collections: Foo and
FooCollection. Then have IBatisNet return an instance of the collection
from within your data access layer:

 public FooCollection GetAll()
 {
  FooCollection fooCollection = new FooCollection();
  GetSqlMap().QueryForList("GetAll", null, fooCollection);
  return fooCollection;
 }

 dg.DataSource = FooDao.GetAll();

Have you looked through the NPetShop example application yet?

 http://www.ibatis.com/common/download.html

There are more robust examples in there.

Reply via email to