How to use derived class shared variables in shared methods of base class
- by KoolKabin
Hi guys,
I am trying to add shared members in derived classes and use that values in base classes...
I have base
class DBLayer
public shared function GetDetail(byval UIN as integer)
dim StrSql = string.format("select * from {0} where uin = {1}", tablename, uin)
....
end function
end class
my derived class
class User inherits dblayer
public shared tabledname as string = "users"
end class
class item inherits dblayer
public shared tabledname as string = "item"
end class
class category inherits dblayer
public shared tabledname as string = "category"
end class
currently there is error using the tablename variable of derived class in base class but i want to use it... coz i dun know other techniques... if other solutions are better then u can post it or u can say how can i make it work? confused...