473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to inherit from sqlconnection

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?

Nov 17 '05 #1
2 7722
What can you do? You can learn the language before trying to code
IDbConnection is an interface
http://www.google.com/search?hl=en&l...%23+interfaces
Happy learning

"Carlos" <a@mapola.com> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
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?


Nov 17 '05 #2
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
}

"Lebesgue" <no****@spam.jp> wrote in message
news:u9*************@TK2MSFTNGP12.phx.gbl...
What can you do? You can learn the language before trying to code
IDbConnection is an interface
http://www.google.com/search?hl=en&l...%23+interfaces
Happy learning

"Carlos" <a@mapola.com> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
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?



Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Fabian Neumann | last post by:
Hi! I got a problem with font-family inheritance. Let's say I have CSS definitions like: p { font:normal 10pt Verdana; } strong { font:normal 14pt inherit;
1
by: Donnie Darko | last post by:
I'm trying to understand SqlConnection(), SqlCommand() For example. I use SqlConnection() as a parameter when I create a new SqlCommand. Then I open SqlConnection(), then I execute the...
5
by: Mike | last post by:
I need to expand the DataSet class by inheriting from it and adding functions that work on the data in the tables. However, since I can't upcast how can I get my base DataSet object assigned an...
4
by: The Coolest Dolphin | last post by:
Hi all, I have a question/problem concerning usage of my sqlconnection throughout my program. In my main form (frmMain) I defined an sqlconnection (I've set the connection public so that I can...
17
by: LP | last post by:
Hello, Here's the scenario: Object A opens a Sql Db connection to execute number of SqlCommands. Then it needs to pass this connection to a constructor of object B which in turn executes more...
4
by: Steve Richter | last post by:
I really miss c++ .... I have an SqlConnection object within my Web.UI.Page object. The thinking is that the connection to the database server is opened once when the page starts to do its...
9
by: Roman | last post by:
Hello I have a component built in VB.2003. It has the following property: Public Shared mCONN As SqlConnection Public Property Connection() As SqlConnection Get Return mCONN End Get...
4
by: Victor | last post by:
Hi Guys I have a problem here. I want to improve the performance for a website. When I looked into the system, I have found that the system made the "SqlConnection Object" static. That mean only...
2
by: GTalbot | last post by:
Hello fellow comp.infosystems.www.authoring.stylesheets colleagues, Imagine this situation: #grand-parent-abs-pos { height: 400px; position: absolute; width: 600px; }
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.