Solved

storing tableadapter rows to an array

Posted on 2007-11-29
4
810 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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