Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database table to an Array

Status
Not open for further replies.

jon159785

IS-IT--Management
Joined
Jul 8, 2003
Messages
15
Location
US
I would like to pull data out of one table of database which has 5 rows and 2 columns into an array. I've set up the dataset and I know how to set up the loops, but what do you have to set up and what commands do you use to pull the data out? Thanks.
 
Oh by the way..... the database is in Access
 
Hi Jon
here are differnt solution
a) You can use HASH TABLE
b) collection to store the data rows

I am assuming the you have set odataTable with rows from
database

Dim OdataTable As DataTable
Dim oRow As DataRow
Dim MyHash As New Hashtable()
Dim MyCol As New Collection()
For Each oRow In OdataTable.Rows
MyHash.Add("", oRow)
Next

'or
For Each oRow In OdataTable.Rows
MyCol.Add(oRow)
Next

Regards
Nouman

Nouman Zaheer
Software Engineer
MSR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top