Solved

storing tableadapter rows to an array

Posted on 2007-11-29
4
812 Views
Last Modified: 2008-02-01
I need to loop through the table adapter and store it as an array.

Should I loop like this?

And if so, How do I put that in an array and define the array?

    For Each NumMembersRow As IDataSet.NumMembersRow In members
        strNumMembers = FormatNumber(NumMembersRow.m_id, 0)
    Next

If there is a better way, please tell me.

thanks.
0
Comment
Question by:Starr Duskk
[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
  • 3
4 Comments
 
LVL 29

Assisted Solution

by:QPR
QPR earned 500 total points
ID: 20378243
if you put the data into a dataread then you can use this...

 If reader.HasRows Then
                For Each rec As System.Data.Common.DbDataRecord In reader
                    arr.Add(rec)
                Next
            End If

0
 
LVL 29

Assisted Solution

by:QPR
QPR earned 500 total points
ID: 20378281
Dim arr As New ArrayList
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 20378357
Can I create a DataSet that puts data into a datareader?

I can ask a new question how to do that, but if I can't do that, then I need an answer that uses my dataset.
0
 
LVL 29

Accepted Solution

by:
QPR earned 500 total points
ID: 20378417
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/GetDataFromDB.aspx
shows you how to create the dataset and how to loop through row by row.
Instead of doing the console.write as this article does... add to your array instead.
No need for a datareader now
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

631 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