M
M O J O
Hi,
I have a baseclass and several clases that inhereits from this
baseclass. In the inherited class I need to change a variable that is
used in the base class, but I cant figure out how.
Here's an example....
Public Class MyBaseClass
Friend Shared _tableName As String
Public Shared Function GetSqlString As String
Return("SELECT * FROM " & _tableName)
End Sub
End Class
Public Class Customor
Friend Shared Shadows _tableName As String = "customor"
End Class
And to test the classes...
Public Sub Main
Dim cust As New Customor
' Below I want a MesBog to show "SELECT * FROM customor", but
' it doesn't. Instead it shows "SELECT * FROM ".
MsgBox(cust.GetSqlString)
End Sub
I now realize that shadowing _tableName in my Customor class is only
visilbe to the Customor class, but how can I somehow tell the baseclass
to user the overwrited _tableName variable?
Any simple solution/suggestions?
Thanks!!!!!!!
M O J O
I have a baseclass and several clases that inhereits from this
baseclass. In the inherited class I need to change a variable that is
used in the base class, but I cant figure out how.
Here's an example....
Public Class MyBaseClass
Friend Shared _tableName As String
Public Shared Function GetSqlString As String
Return("SELECT * FROM " & _tableName)
End Sub
End Class
Public Class Customor
Friend Shared Shadows _tableName As String = "customor"
End Class
And to test the classes...
Public Sub Main
Dim cust As New Customor
' Below I want a MesBog to show "SELECT * FROM customor", but
' it doesn't. Instead it shows "SELECT * FROM ".
MsgBox(cust.GetSqlString)
End Sub
I now realize that shadowing _tableName in my Customor class is only
visilbe to the Customor class, but how can I somehow tell the baseclass
to user the overwrited _tableName variable?
Any simple solution/suggestions?
Thanks!!!!!!!
M O J O