how do I display array contents in a gridview/table?

  • Thread starter Thread starter Sofa_snake
  • Start date Start date
S

Sofa_snake

Hello Everyone
VB express 2008
I have written a programme to perform current limit on a power supply
and log all of the voltages and currents on up to 8 outputs. This can
be in a number of steps set by the user. The programme works
perfectly and the results are stored nicely in the arrays (8 channels
wide, users number of steps long) I just cant output these results to
the user apart from looking at the array contents when debugging?
any ideas? ie data tables that can be displayed when the process is
completed? and how do I populate these tables?

I can include more code if required, but Ive written a pretty hefty
programme

' Dim tempV(0 To 7) As String

' tempV = Split(message, ",", -1)
' For z = 0 To 7
' ActOutV(x - 1, z) = tempV(z)
' Next

code repeats for tempI(0 to 7)

Thank you for your help! I have struggled to find websites on this!
 
Something I neglected to add
I want these results to be transferrable ie copy pastable ideally to
excel for using in reports
ie so i can draw results/graphs for ch1 voltage (ActOutV1) against ch1
current (ActOutC1)
 
Hi

Because I didnt know how to from the beginning and still don't know.
I thought it would be simpler once the arrays were populated to
transfer but no such luck.
:P

Dan
 
Hi Dan,

Here below I type something in this reply, forgive me as I make some simple
mistakes, but I will try to do it for a real beginner with datatables.

Option Infer On


\\\
Dim dt as new Datatable ' Here you instance a new datatable that is all you
need
Dim dc1 as new DataColumn 'Here you describe a columns, in this way it is
simple an object, columns belong to the tables and are for the items in a
row
Dim dc2 as new DataColumn 'A second column
dt.Columns.Add(dc1)
dt.Columns.Add(dc2)
dim dr = dt.rows.NewRow
dt.item(1) = "Dan"
dt.item(2) = "Snake"
dt.Rows.Add(dr)
///

Now you have a datatable that you can set to the datasource of a gridview
\\\
gridview1.Datasource = dt
gridview1.Databind 'Dont forget this one, (I hope you are trully talking
about a GridView which is an AspNet control
///

Cor


Hi

Because I didnt know how to from the beginning and still don't know.
I thought it would be simpler once the arrays were populated to
transfer but no such luck.
:P

Dan
 
Back
Top