Dumb Question

  • Thread starter Thread starter Andy Williams
  • Start date Start date
A

Andy Williams

Is it possible to populate a datagrid on a windows form using a datareader?
I do it all the time in asp.net, but I'm new to windows forms and I can't
get it to work. I get:

An unhandled exception of type 'System.InvalidCastException' occurred in
system.data.dll
Additional information: Object must implement IConvertible.

Any ideas?

Thanks

-Andy

www.fairbornusa.com
williamsla at fairbornusa.com
 
Hi,

No

Ken
-----------------------
Is it possible to populate a datagrid on a windows form using a datareader?
I do it all the time in asp.net, but I'm new to windows forms and I can't
get it to work. I get:

An unhandled exception of type 'System.InvalidCastException' occurred in
system.data.dll
Additional information: Object must implement IConvertible.

Any ideas?

Thanks

-Andy

www.fairbornusa.com
williamsla at fairbornusa.com
 
Yes and No.

No because you cannot Directly. Anything that databinds to a datagrid must
implement IList, and DataReader does not.

Yes, because you could populate your own object using a datareader that
implements IList.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top