I am not even sure if this is possible, I am pulling in data from a DB, populating 2 text fields, just so I can calculate the difference between the two, and then I want to display the difference in the datagrid. This is what I have so far:
Kai-What?
Code:
Dim DataReader As OleDbDataReader
DataGrid1.Visible = True
Dim myDA As OleDbDataAdapter = New OleDbDataAdapter(cmdSelect)
Dim myDataSet = New DataSet
Dim myDataSet2 = New DataSet
myDA.Fill(myDataSet, "EQ_METER_READING")
myDA.Fill(myDataSet2, "WO_PM_SCHEDULE")
Dim Row As DataRow
If myDataSet.Tables("EQ_METER_READING").Rows.Count > 0 Then
Row = myDataSet.Tables("EQ_METER_READING").Rows(0)
End If
If Row.Item("READING") Is DBNull.Value Then
READING.Text = String.Empty
Else
READING.Text = Row.Item("READING")
End If
If myDataSet2.Tables("WO_PM_SCHEDULE").Rows.Count > 0 Then
Row = myDataSet2.Tables("WO_PM_SCHEDULE").Rows(0)
End If
If Row.Item("NEXT_EXE_UNITS") Is DBNull.Value Then
NEXT_EXE_UNITS.Text = String.Empty
Else
NEXT_EXE_UNITS.Text = Row.Item("NEXT_EXE_UNITS")
End If
Dim CyclesRemaining As Integer
CyclesRemaining = (Int32.Parse([NEXT_EXE_UNITS].Text) - Int32.Parse([READING].Text))
DataGrid1.DataSource = cmdSelect.ExecuteReader
DataGrid1.DataBind()
Kai-What?