According to this article:

http://www.ondotnet.com/pub/a/dotnet/2003/09/02/ilist.html
"
It's no accident that DataSet, Array, TreeNodeCollection, and many
other collection classes all behave in a predictably similar fashion.
Each of them derive from the IList interface and each of them fully
implement all of the methods defined by that interface's contract.
Thus, you can use them as data sources for iterative controls like the
DataGrid or list controls like DropDownList.
"

You should be able to bind a DataGrid to an IList returned from one
iBatis' IList methods.

I don't see how iBatis could know automatically know to change a
resultClass of DataTable into a DataRowCollection for the DataTable.
Plus the .Rows property on the DataTable is read-only.

I do this a lot:

IList list = ExecuteQueryForList("FooGetMany", null);
for (int i=0;i<list.Count;i++)
{
fooCollection.Add((Foo)list[i]);
}

The only question I've had with that is do I need to check 'list' to
see if is null or am I guaranteed to get an empty (i.e. Count=0) IList
object back if the qeury returned zero results?

- Ron

--- Rahul Singh <[EMAIL PROTECTED]> wrote:

> "One trick I've been using is to push query results into a DataTable,
> which work well with DataGrids and such."
> 
> Do you just specify "DataTable" in the result class? or cast it from
> another object?
> 
> Rahul
> 

Reply via email to