Solved

Collection data into a datagrid

Posted on 2003-12-05
1
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
This is an explanation of a simple data model to help parse a JSON feed
Six Sigma Control Plans
Starting up a Project

690 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