Solved

storing tableadapter rows to an array

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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