Re: Datareader binding to datagrid not working

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Android web apps
    ... things that web apps cannot do. ... If you want to use features of the device you have to bridge to the ... the software you are writing and the audience you are writing it for. ...
    (comp.databases.pick)
  • Re: confused about crystal reports with .NET 2.0 and C#[need basic advice]
    ... to impress people at work i tried writing my ... etc from a Win forms app which uses an access database. ... Is that only for web apps, if it is'nt then could anyone point me to a ...
    (microsoft.public.dotnet.general)
  • Re: How to export from Access to CSV?
    ... Paul sent I think those are easier solutions then writing it out yourself. ... Greetz Peter ... >> read the data into a dataset or datareader and write the data out to a ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Detecting multiple class loaders
    ... My feeling is that you have multiple web apps all writing to one single file. ...
    (comp.lang.java.programmer)
  • Re: Which Version of Delphi (Professional, Enterprise, Architect)
    ... I'm writing the software for someone else. ... The mySql stuff is his problem, ... Check the licencing if it's not going to be a web application (e.g. ... thought.Works well for web apps though. ...
    (borland.public.delphi.non-technical)