How to inherit from sqlconnection

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

I would like to create a component that inherits from sqlconnection, but it
is sealed. What ancestor can I inherit from?

I've seen this:

public sealed class SqlConnection : Component, IDbConnection,
ICloneable

So, I've tried:

public class MyConnection : Component, System.Data.IDbConnection, ICloneable



But I obtain a lot of errors saying:

'MyConnection.MyConnection' does not implement interface member
'System.Data.IDbConnection.xxxxxxxxxxxxxx()'

What can I do?
 
General note:

Don't inherit, use composition instead

class MyComponent
{
private SqlConnection connection;
....
public void Open()
{
connection.Open();
}

public ConnectionState State
{
get {return connection.State;}
set {connection.State = value;}
}
//and so on
}
 
Back
Top