J
Jeremy S
Why can we NOT fill a ListView by binding it to a DataTable?
When I try this code...
MyListView.DataSource = myDataTable;
MyListView.DataBind();
.... the application chokes with the error:
"The DataSourceID of 'MyListView' must be the ID of a control of type
IDataSource. A control with ID 'ProductsSqlDataSource' could not be found."
Yes, I know google is my friend, and what I was able to find was info
stating that I had to loop through the DataTable and add rows, one at a
time.
example:
http://www.codeguru.com/csharp/csharp/cs_controls/tutorials/article.php/c8071
I don't want to use a SqlDataSource - I need the flexibility offered by the
traditional approach I attempted above.
Thanks.
When I try this code...
MyListView.DataSource = myDataTable;
MyListView.DataBind();
.... the application chokes with the error:
"The DataSourceID of 'MyListView' must be the ID of a control of type
IDataSource. A control with ID 'ProductsSqlDataSource' could not be found."
Yes, I know google is my friend, and what I was able to find was info
stating that I had to loop through the DataTable and add rows, one at a
time.
example:
http://www.codeguru.com/csharp/csharp/cs_controls/tutorials/article.php/c8071
I don't want to use a SqlDataSource - I need the flexibility offered by the
traditional approach I attempted above.
Thanks.