Solved

Collection data into a datagrid

Posted on 2003-12-05
1
331 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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now