Need Help With DataSet retrevial

Hi

I am using VB.Net 2005 and have created the following dataset with a click event on Form2. My question, being new to this, is how to retrieve this dataset on Form3 or for that matter on Form2?

Thanks

PBLack

'build report dataset
        Dim dt As New DataTable("StandInfo")
        dt.Columns.Add("StandNum")
        dt.Columns.Add("Area")
        dt.Columns.Add("SampleSize")
        dt.Columns.Add("TotalPoints")
        dt.Columns.Add("Intensity")

        Dim row As DataRow = dt.NewRow()
        Dim item As ListViewItem
        For Each item In lvStands.Items
            row("StandNum") = item.Text
            row("Area") = item.SubItems(1).Text
            row("SampleSize") = item.SubItems(2).Text
            row("TotalPoints") = item.SubItems(3).Text
            row("Intensity") = item.SubItems(4).Text
            dt.Rows.Add(row)
            row = dt.NewRow()
        Next
PBLackAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DEEPESHCommented:
Simple declare a property on form3 or better declare a constructor with dataset as a parameter on form3
such as
Public Sub New (byval ds as dataset)
'Now assign this ds to a variable of type dataset
'and then you can read ds
end sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PBLackAuthor Commented:
I my example I created a table. No where did I declare a dataset ... is what I did ok? Will it still fit in with your example?

My end goal is to populate listviews and textboxes with this data as I build it. Also where is the datatable stored? In memory?
0
ReecioCommented:
if you want to create a dataset in code that's usable over the other forms you'll have to publically declare the variable, otherwise its just allocated to that sub.
Just under Public Class Form1 put Public ds As DataSet and in other forms you should eb able to reference Form1.ds etc.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.