Last post Oct 25, 2010 08:46 AM by reas
Oct 25, 2010 08:18 AM|mkavand|LINK
hi there ,
I have this part of code and I using entllib 5 :
Database DB = DatabaseFactory.CreateDatabase("Cs");
using (IDataReader Reader = DB.ExecuteReader("select"))
GridView_Video_Download.DataSource = Reader;
and I get this error :
db.executereader executereader idatareader
Oct 25, 2010 08:46 AM|reas|LINK
You can't databind an IDataReader. You must first read the data from your Reader object into some kind of collection like Arraylist, List<>, Hashtable etc.
Then once the data is in the list, you databind the list to the gridview, not the reader.
hope this helps