A
al
The following code tries to count the record in the dataset but fails
when I wrap it up in a if statement. Please help, go easy on any
stupidity because I am new to dotnet. The Data is gathered from a
Paradox table and that part appears to work because the dataset
contains the record i require.
myInt = DsDataSet.Tables("PXResult").Rows.Count
'the above line makes myint equal 1
If myInt > 0 Then
MsgBox(CType(myInt, String) & " with the first called
" & DsDataSet.Tables("PXResult").Rows(0).Item("FirstName"),
MsgBoxStyle.OKOnly)
End If
If DsDataSet.Tables("PXResults").Rows.Count = 1 Then
'the above line crashes
I get the following error:-
An unhandled exception of type 'System.NullReferenceException'
occurred in Subcon.exe
Additional information: Object reference not set to an instance of an
object.
Many thanks
Al
when I wrap it up in a if statement. Please help, go easy on any
stupidity because I am new to dotnet. The Data is gathered from a
Paradox table and that part appears to work because the dataset
contains the record i require.
myInt = DsDataSet.Tables("PXResult").Rows.Count
'the above line makes myint equal 1
If myInt > 0 Then
MsgBox(CType(myInt, String) & " with the first called
" & DsDataSet.Tables("PXResult").Rows(0).Item("FirstName"),
MsgBoxStyle.OKOnly)
End If
If DsDataSet.Tables("PXResults").Rows.Count = 1 Then
'the above line crashes
I get the following error:-
An unhandled exception of type 'System.NullReferenceException'
occurred in Subcon.exe
Additional information: Object reference not set to an instance of an
object.
Many thanks
Al