Hi!
That said, I have been trying to
write something in bits and pieces.
Most of it works (quite surprisingly!).
However, this snippet is causing me
quite some trouble:
where DS is a dataset and OIDdidxxx has
been previously created (and data entered).
The MsgBox gives me the expected number.
However, the similar expression in the "for"
condition gives me an "Object reference not
set to an object" exception. I had originally
tried it as:
but that gives me the same expression.
Anyone know what may have gone wrong?
Suggestions?
Thanks in advance!
PS: PLEASE don't ask me to post a more complete
code fragment. The code preceding it uses a custom
control, which calls a custom type, which I think calls
another custom type. I'd rather not spend a whole
afternoon fishing out the smallest set of code for it
to be readable. Of course, if the problem doesn't seem
to arise from the code posted above, I won't have much
choice
That said, I have been trying to
write something in bits and pieces.
Most of it works (quite surprisingly!).
However, this snippet is causing me
quite some trouble:
VB.NET:
MsgBox(CType(DS.Tables("OIDdid" & _
OID("OID")), DataTable).Rows.Count)
Dim MID As DataRow, i As Integer
For i = 0 To CType(DS.Tables("OIDmid" & _
OID("OID")), DataTable).Rows.Count - 1
been previously created (and data entered).
The MsgBox gives me the expected number.
However, the similar expression in the "for"
condition gives me an "Object reference not
set to an object" exception. I had originally
tried it as:
VB.NET:
For Each MID as Datarow in DS.Tables("OIDmid" & _
OID("OID")).Rows
but that gives me the same expression.
Anyone know what may have gone wrong?
Suggestions?
Thanks in advance!
PS: PLEASE don't ask me to post a more complete
code fragment. The code preceding it uses a custom
control, which calls a custom type, which I think calls
another custom type. I'd rather not spend a whole
afternoon fishing out the smallest set of code for it
to be readable. Of course, if the problem doesn't seem
to arise from the code posted above, I won't have much
choice
Last edited by a moderator: