I have class, which returns dataTable to populate my list box on some other
pages:
public class dataClass
{
private Int16 _lvlRights=1
public static DataTable dtAdv()
{
if (_lvlRights == 1)
{
//my code......
}
}
}
I get an error:
Error 1 An object reference is required for the nonstatic field, method, or
property 'dataClass._lvlRights'
If I remove static keyword from dtAdv method than it works, but than I can't
call my class from other pages:
lstBox.DataSource=dataClass.dtAdv()
How can I use variable _lvlRights in my static methods?
Regards,S