variables declared as
public int curUserID = 0, ViewUserID = 1;
the form is inherited by the "Form" class.
I m using these variables on all the other forms.
But this gives the warning - "Accessing a member on
'LabTest.frmSBTUSA.ViewUserID' may cause a runtime exception because
it is a field of a marshal-by-reference class"
>From ur writing i know that making the variables static will solve theproblem.
But it i change the declaration statement from the above as
public static int curUserID = 0, ViewUserID = 1;
Now, this statement gives me a error instead of warning. The error is
- "Static member 'LabTest.frmSBTUSA.ViewUserID' cannot be accessed
with an instance reference; qualify it with a type name instead"
Many other variables are also declare along with these variables and
also used from all the other forms of the application. The marshal-by-
refrence error is not reported while using all those other variables.
Pls help me.