Hi all, i hope i can explain mysel, english is no my first language.
Well, i have a base class (a wrapper to work with oledb) with some properties and methods, and i have a inherited class (wrapper to odbc), something like this:
Public Class Base
Protected Connection as OleDbConnection
Protected Command as OleDbCommand
Public ReadOnly Property ServerVersion as String
Get
If Not IsNothing(Connection) Then Return Connection.ServerVersion
End Get
End Property
Public Function ExecuteReader(byval SQL as String) As OleDbDataReader
Return Command.ExecuteReader(SQL)
End Function
End Class
Public Class Child
Inherits Base
Protected Shadows Connection As OdbcConnection
Protected Shadows Command As OdbcCommand
Public Shadows ReadOnly Property ServerVersion as String
Get
If Not IsNothing(Connection) Then Return Connection.ServerVersion
End Get
End Property
Public Function Shadows ExecuteReader(byval SQL as String) As OdbcDataReader
Return Command.ExecuteReader(SQL)
End Function
End Class
How can I achieve something like that but with less code?, if i dont repeate the code of every property in the child class it uses the Connection objet of the base class (returning "" in the ServerVersion property for example), or what is the correct way of doing this, thanks a lot.
Juan Zamudio