Databinding Typed Views?

Posts   
 
    
ChadThiele
User
Posts: 2
Joined: 23-Feb-2005
# Posted on: 23-Feb-2005 09:17:54   

I have a couple Typed Views that, when I try to databind them to a datagrid in asp.net, I get the following error:

An invalid data source is being used for DataGrid1. A valid data source must implement either IListSource or IEnumerable.

I'm basically doing this:

DataGrid1.DataSource = newTypedView.Fill(); DataGrid1.DataBind();

Note: names changed for posting online.

Is there a way to databind a typed view to a datagrid in asp.net?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 23-Feb-2005 12:26:52   

Fill() returns a boolean, so you're binding to a boolean simple_smile

First call Fill, then set the DataSource.

Frans Bouma | Lead developer LLBLGen Pro
ChadThiele
User
Posts: 2
Joined: 23-Feb-2005
# Posted on: 24-Feb-2005 00:09:01   

Otis wrote:

Fill() returns a boolean, so you're binding to a boolean simple_smile

First call Fill, then set the DataSource.

Doh! So easy... lol. Thanks for the help! simple_smile