PDA

View Full Version : When store's datasource is IDataReader, as SqlDataReader or OracleDataReader, after bind(), the data's number will reduce 1



pd163
Feb 11, 2009, 4:05 AM
First, my english is poor.

When I used IDataReader as the store's datasource, I found at last the data show on the GridPanel reduce 1.

I looked over the source code, in StoreDataBound.cs file, CreateAutoFieldProperties method


StoreDataBound.cs
---------------------------
AutoGeneratedFieldProperties[] CreateAutoFieldProperties(IEnumerable source)
{
....


IEnumerator en = source.GetEnumerator();


....
}


I guess, IDataReader is forward only, when "source.GetEnumerator()" is executed, the count of IDataReader reduce 1.