I want to pass myConnString in all forms. ( I am working in winform and mysql C#. ) So I tried this link.
static class GlobalClass
{
private string myConnString = "";
public static string GlobalVar
{
get { return myConnString; }
set { myConnString = value }
}
}
The above code gives the error :-
An object reference is required for the non-static field, method, or property
What is the mistake?.