Posted on: 2/22/2012 2:38:12 PM | Views : 690

I have seen a number of posts on this subject and ca't get this to work.  Here's the situation.
I nned to capture an ID immrdiately after a record is added, to use in the following steps of the program.
I added this code to the "Insert" query in SQL Express at the very end:
 SELECT @@IDENTITY AS 'intIdentity';
In Visual Basic 2010 I added this line of code to the Insert block of code:
intLoanID = CType(oData.objDR.Item("intIdentity"), Integer)
When I run Visual Basic, it executes up to the code above an then throws the error:
"Object reference not set to an instance of an object."
Any Suggestions

sirmilt
...

Go to the complete details ...