Object Reference not set to an instance of an object

L

Lou Civitella

I created a VB.Net program that runs a SQL 2000 DTS package via code.
Created the DTS package in SQL 2000 and then saved it as a vb file. Imported
into VB.Net. Everything works OK except when the code tries to run the dts
package code twice. The first time everything runs OK. When it has to run
the same code a second time it gives me the error message stated in the
Subject of this message.

when it hits the first line of the DTS package Main code is where I get the
error message.

Has anyone ever experienced this and if so how do I fix?

Thanks,
Lou
 
N

Neil Wallace

I may be way off mark here....

but is VB.Net generating new code automatically?

I had a problem where I had a public shared variable which the form
generator kept defaulting to private.

The program would work dandy first run, and then give a message similar to
the one you experience after I had viewed the form in the studio
environment.
 
L

Lou Civitella

Hi Neil,

Thanks for the reply. I did however find out what the problem was. When the
code is generated from SQL it creates two Public variables. All I had to do
was move them to the Main function and declare them using the normal Dim
statement.
After this everything worked as it should.

Thanks Again,
Lou
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top