Hi everyone,
do you remember ALF? "Stuck on earth" - that's the way I'm feeling.
What I want to do is update the datagrid with the new values I got from this Sub (handled by a timer):
In the second run I get a "no value for index 0".
What am I doing wrong?
Thanks for your help.
wtfia2k
do you remember ALF? "Stuck on earth" - that's the way I'm feeling.
What I want to do is update the datagrid with the new values I got from this Sub (handled by a timer):
Code:
Private Sub HandlefrmStatus(ByVal aEvents As Array, ByVal bFirstRun As Boolean)
Dim iClear As Decimal
Dim i, j As Integer
Dim ds As New DataSet
Dim tbl As New DataTable("EVENTS")
Dim col As DataColumn
Dim row As DataRow
ds.Tables.Add(tbl)
col = tbl.Columns.Add(" ")
For i = 1 To aEvents.GetUpperBound(1)
col = tbl.Columns.Add(aEvents(0, i))
Next i
For i = 1 To aEvents.GetUpperBound(0)
row = tbl.NewRow()
For j = 0 To aEvents.GetUpperBound(1)
row(j) = aEvents(i, j)
Next j
tbl.Rows.Add(row)
Next i
frmStatus.DataGrid1.DataBindings.Clear()
frmStatus.DataGrid1.SetDataBinding(ds, "EVENTS")
frmStatus.Opacity = 0
frmStatus.Refresh()
frmStatus.Visible = True
If frmStatus.Opacity < 1 Then
'we fade in
For iClear = 0 To 1 Step 0.001
frmStatus.Opacity = iClear
Next
End If
End Sub
In the second run I get a "no value for index 0".
What am I doing wrong?
Thanks for your help.
wtfia2k