Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

DataGrid data to an array

I use an ACCESS database recordset to store columns of numbers that I would like to plot on an x-y chart in a VB program. I can pull the data easily into my VB program using DataGrid and display it on the screen.
What I'd like to do with the data is select two columns and put that data into a two dimensional array so I can plot the data on an x-y chart. It seems like there should be an easy way to do this but I'm getting nowhere. Any solutions??
BOB
0
rafox
Asked:
rafox
  • 2
  • 2
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
Take a look at the GetRows method (of the ADO object).
0
 
Éric MoreauSenior .Net ConsultantCommented:
Take a look at the GetRows method of the ADO recordset object.
0
 
AzraSoundCommented:
you might consider creating a udt rather than a two dimensional array, e.g.

Private Type coords
   x As Variant
   y As Variant
End Type
0
 
rafoxAuthor Commented:
emoreau--
GetRows works -- I was looking for something from DataGrid but as long as I can get the data into the arrays, I'm OK.

BOB



AzraSound--
Is there any advantage to using a udt as you suggested when using the data in an XY plot using MSChart Control. How would I use it?

BOB
0
 
AzraSoundCommented:
no not really other than the fact you dont have to work with two dimensional arrays.  If that isnt a bother to you then there really is no need to go with the udt's.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now