Results 1 to 3 of 3

Thread: How can I fix this problem? "Object reference not set to an instance of an object"

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Windsor
    Posts
    100

    How can I fix this problem? "Object reference not set to an instance of an object"

    Hi,

    I am using .NET 2003. I connect to the SQL Server with SqlConnection class and store table data in a Dataset and display it with DataGrid. My application works very well with my development PC. When I create an executable and install it to other pc’s, I get an error message “Object reference not set to an instance of an object” and no information is displayed in the DataGrid. I get this error message 3 times after installing the application and then system does not display it again.
    I do not know how to fix this problem. I would appreciate if you have any idea to fix it.

    Naci

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Did you set try catch blocks around your erroneous methods or any code that you suspect it make error ? This will give you -hopefully- more informative error messages .

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    I agree with Pirate, from the sound of the error message I would bet that your SQL connection failed.

    You need to add more error handling to get a definitive answer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width