Home All Groups Group Topic Archive Search About
Author
14 Aug 2006 3:30 PM
Agnes
I had declare the keyconstraint.
            Dim con_id_rv As ForeignKeyConstraint
            con_id_rv = New ForeignKeyConstraint("fk_id",
dtInv.Columns("invno"), dtRv.Columns("invno"))

However, I got one error
Object reference not set to an instance of an object.

Please help.
Thanks a lot

Author
14 Aug 2006 3:35 PM
Marina Levit [MVP]
Why don't you put a breakpoint where you are creating the constraint, and
make sure all these objects aren't null. This would be the easiest and
fastest way to fix the problem.

Show quoteHide quote
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%23X8kAZ7vGHA.4436@TK2MSFTNGP06.phx.gbl...
>I had declare the keyconstraint.
>            Dim con_id_rv As ForeignKeyConstraint
>            con_id_rv = New ForeignKeyConstraint("fk_id",
> dtInv.Columns("invno"), dtRv.Columns("invno"))
>
> However, I got one error
> Object reference not set to an instance of an object.
>
> Please help.
> Thanks a lot
>
>