Solved

Collection data into a datagrid

Posted on 2003-12-05
1
334 Views
Last Modified: 2010-04-17
In a VB.NET webform, I'm trying to display data.
I have created a collection containing the data and now want to use a datareader to display it in a datagrid.

Could someone tell me what additional lines of code to use (after the "coll ..... line" to get the collection displayed into a datagrid? Here is the loop that puts data in the collecrion:

            Do While DataReader.Read
            collOperatorActionsByActionCode_PerfRate.Add(DataReader.Item("Rate"))

            Loop

Thanks,
Michael
0
Comment
Question by:michael5865
1 Comment
 
LVL 9

Accepted Solution

by:
malharone earned 500 total points
ID: 9885975
why not just

datagrid1.datasource=SOURCE_TYPE

where the SOURCE_TYPE could be any one of the following:
DataTable
DataSet
DataView
DataViewManager


so instead of getting the reader, get the dataset object from the SQLDATAADAPTER or the OLEDBDATAADAPTER.

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question