static method

I am working with winforms and in the file section I have a file that needs to be accessed from a static method.  I get the following error message on fields that are associated with that file...error code COBCH0969, Cannot access object data from a static method or field.    In order to fix these compile errors I put the keyword static on the FD of the file.  When I run the program in this way I get a runtime error of NullRefernceException -- object reference not set to an instance of an object. 

Now I realize that I could make the method as public and my problems would go away, but I really don't want to have to do this.  How can I resolve this issue?  Thanks

Tags:

Parents
  • I had an earlier product release and then just this week I installed the 2.2.  I'm on Windows 7 Professional Service Pack 1.  I did un-install both the 2.2 release and the data tools 2.2 and I am still having problems in my program. It should also be noted that a co-worker is running pretty much the same software and he is having issues.

    I accidently selected NO on that error message that I sent you earlier (attached), do you know how to turn that back on? 

Reply
  • I had an earlier product release and then just this week I installed the 2.2.  I'm on Windows 7 Professional Service Pack 1.  I did un-install both the 2.2 release and the data tools 2.2 and I am still having problems in my program. It should also be noted that a co-worker is running pretty much the same software and he is having issues.

    I accidently selected NO on that error message that I sent you earlier (attached), do you know how to turn that back on? 

Children
No Data