Good day, just a quick question:
I would like to bind a table to a checkboxlist control, so I did this in the Page_Load method:
CBL_categ.DataSource = FilmsAccess.Pop_check();
CBL_categ.DataBind();
I specify that Pop_check returns a table of one column.
When I run, instead of the values in that column, I see "System.Data.DataRowView" a number of times, with the check boxes. I also tried:
CBL_categ.DataSource = FilmsAccess.Pop_check().Column[0]; but it gives this error: Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.
Thanks a lot. Anna
EDIT: Here’s the Pop_check() method at request:
public static DataTable Pop_check()
{
DbCommand com = GenericDataAccess.CreateCommand();
com.CommandText = "Catalog_CBL";
DataTable table = GenericDataAccess.ExecuteSelectCommand(com);
return table;
}
In the ASCX file bind following two field, preferably by name