How to use derived class shared variables in shared methods of base class

Posted by KoolKabin on Stack Overflow See other posts from Stack Overflow or by KoolKabin
Published on 2010-06-04T07:45:51Z Indexed on 2010/06/05 13:32 UTC
Read the original article Hit count: 361

Filed under:
|
|
|

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...

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about class