Hello,
I'm having trouble with a dataview.
My code looks like this:
dv1 is declared public at the class level
then in my sub:
dv1 = New DataView
With dv1
.Table = DsCBLP1.Tables("TDT_CUT_BLOCK_LP")
.RowFilter = "ID_CUT_BLOCK = '" & txtBlockID.Text & "'"
End With
My textboxes are populated by this code:
Me.txtLPsiteFactor.DataBindings.Add("text", dv1, "STR_CRITICAL_FACTORS")
Often there is no data available to match the given filter. For the textboxes this is fine, there is no error, it just leaves the textboxes blank.
Where I'm running into trouble is when I'm using a variable, like this:
drvCBLP = dv1(0)
LPtype = drvCBLP("STR_TYPE")
This gives me an error if there is no data.
How can I get around this? Or test to see if there is data before executing the above code??
Thanks,
Sorry it's so lenthy,
amber
I'm having trouble with a dataview.
My code looks like this:
dv1 is declared public at the class level
then in my sub:
dv1 = New DataView
With dv1
.Table = DsCBLP1.Tables("TDT_CUT_BLOCK_LP")
.RowFilter = "ID_CUT_BLOCK = '" & txtBlockID.Text & "'"
End With
My textboxes are populated by this code:
Me.txtLPsiteFactor.DataBindings.Add("text", dv1, "STR_CRITICAL_FACTORS")
Often there is no data available to match the given filter. For the textboxes this is fine, there is no error, it just leaves the textboxes blank.
Where I'm running into trouble is when I'm using a variable, like this:
drvCBLP = dv1(0)
LPtype = drvCBLP("STR_TYPE")
This gives me an error if there is no data.
How can I get around this? Or test to see if there is data before executing the above code??
Thanks,
Sorry it's so lenthy,
amber