Re: Datareader binding to datagrid not working
- From: I Don't Like Spam <no@xxxxxxxx>
- Date: Wed, 25 Jan 2006 21:46:58 -0500
tshad wrote:
I am using VS 2003 and trying to build a standalone application. I have been writing all my asp.net work using DW and am just now trying to build a application that will read some of the tables I had written out from my web apps.
I can get my DataReader to read my data fine. But I wanted to use a DataGrid, but it is apparently completely different????
I can do:
DataGrid1.DataSource = dbReader DataGrid1.DataBind()
I get an error saying something about: "Complex DataBinding accepts as a data source either an IList or an IListSource".
There also doesn't seem to be a DataBind() method to this DataGrid?
Why doesn't it work?
Can I not make a standalone program using the same techniques as I do in my Web pages (asp.net)?
Thanks,
Tom
You can not bind a datareader to a datasource. You will need to either load it into a datatable by looping through the datareader or use a dataadapter to do what you want.
chris .
- Follow-Ups:
- Re: Datareader binding to datagrid not working
- From: tshad
- Re: Datareader binding to datagrid not working
- References:
- Datareader binding to datagrid not working
- From: tshad
- Datareader binding to datagrid not working
- Prev by Date: Re: Maximize and ToolStrips
- Next by Date: Re: Datareader binding to datagrid not working
- Previous by thread: Datareader binding to datagrid not working
- Next by thread: Re: Datareader binding to datagrid not working
- Index(es):
Relevant Pages
|