B
Brett
I'm not sure why I keep getting this error, "Object reference not set to an
instance of an object".
Private Function somefunction() as string
Dim MyCurrentClass As New Class1
Try
For i As Integer = 0 To LinkResults.Length - 1
With MyCurrentClass.SqlCmd_Insert_LinkVB
.CommandType = System.Data.CommandType.StoredProcedure
'error occurs here
-- do something --
End Function
The above code is in Class1. If there is a problem with the reference to
the object instance, why doesn't this line throw an error at
With MyCurrentClass.SqlCmd_Insert_LinkVB
The new class has been created, which means there is an instance available.
What am I doing wrong?
Thanks,
Brett
instance of an object".
Private Function somefunction() as string
Dim MyCurrentClass As New Class1
Try
For i As Integer = 0 To LinkResults.Length - 1
With MyCurrentClass.SqlCmd_Insert_LinkVB
.CommandType = System.Data.CommandType.StoredProcedure
'error occurs here
-- do something --
End Function
The above code is in Class1. If there is a problem with the reference to
the object instance, why doesn't this line throw an error at
With MyCurrentClass.SqlCmd_Insert_LinkVB
The new class has been created, which means there is an instance available.
What am I doing wrong?
Thanks,
Brett