Solved

storing tableadapter rows to an array

Posted on 2007-11-29
4
799 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:BobCSD
  • 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 1

Author Comment

by:BobCSD
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

13 Experts available now in Live!

Get 1:1 Help Now