Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 25, 2010 12:46 PM by reas
Oct 25, 2010 12:18 PM|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 12:46 PM|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