Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Collection data into a datagrid

Posted on 2003-12-05
1
Medium Priority
?
339 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Make the most of your online learning experience.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

610 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