Null Reference Exception was Unhandled
I have been trying to retreive information from database A and pass it on to database B
Dim mr As DataRow = dsProben.Tables("T_Proben").NewRow
Dim dr1 As DataRow = dsProzessmodule.Tables("T_Prozessmodule").Rows.Find(selectedKey)
mr("pProzessmodulGUID") = dr1("ProzessmodulGUID")
though this works in other forms it doesnt seem to work here. I get the error NUll Reference Exception was Unhandled
could someone help me this.
thanks
donny
Re: Null Reference Exception was Unhandled
When you get a NullReferenceException, the first thing to do EVERY time is to determine exactly which reference is null. You can't solve a problem if you don't know what problem it is. Once you know that you can backtrack to the point that you expected a value to be assigned and that is where the problem lies. In your case I would guess that 'dr1' is Nothing because the table doesn't contain 'selectedKey'. That's just an educated guess though.