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??
Who is Participating?
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
Take a look at the GetRows method (of the ADO object).
Éric MoreauSenior .Net ConsultantCommented:
Take a look at the GetRows method of the ADO recordset object.
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
rafoxAuthor Commented:
GetRows works -- I was looking for something from DataGrid but as long as I can get the data into the arrays, I'm OK.


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?

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.