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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to: Get data from ACCESS into an array ?

Status
Not open for further replies.

terryomag

Programmer
Aug 30, 2005
6
US
I have my data in an ACCESS database. I know how to use a Datagrid to display the data, but I need to get the contents of the rows and columns into arrays (in a VB.Net program) so I can manipulate the data. How can I do this? Sorry if this is a third-grade question.
 
If you want to manipulate the data I suggest you start reading the help files on the System.Data.OleDb namespace, in particular the OleDbConnection, OleDbDataAdapter, OleDbCommand, DataSet, DataTable and DataRow classes.

In general, you have to define a connection using the OleDbConnection class. Then you query the connected database using the OleDbDataAdapter. Next you fill the DataSet with the acquired data and use the DataRow class to get the data per row. To edit the data you use the OleDbCommand class (in combination with using an SQL query).

Storing your data into arrays is thus not neccessary, for VS gives you plenty of classes to store, view and manipulate data in an Access database.

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top