Thanks Howard and Ray,

The idea of a custom control (not a user control, but a full-blown designer
visible control) is very appealing.  I was wondering, however, how to give
the data designer an idea to use my control in place of a connection object.
Would simply implementing IDbConnection suffice?  I think there may be more
to it, this is why I'm asking :))

Kamen

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Ray Dixon
Sent: 03 Март 2003 г. 19:37
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] IDE and SqlConnection question


You might want to take a look at creating a User Control of your own that
you could use for your data connections.

-----Original Message-----
From: Howard Pinsley [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 8:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] IDE and SqlConnection question

>>>
Now the actual question: is there a way to add a SqlConnection object (or
possibly another class, but implementing the proper interface) that is
accessible by the VS IDE designer, I can see it on the design surface, use
it at design time, and yet at runtime I want to be able to "replace" - or
"attach" a connection obtained from another source to this object so that I
don't keep connection strings in my source code (or rather, prevent the IDE
from autogenerating this code)? <<<

I have dealt with this by adding adapters via the IDE.  As you indicated,
the IDE will generate additional connection objects.  I just delete the
extra ones and simply leave one.  Then I modify the adapters to use the sole
connection object.  As for the actual command string -- I override the one
in use in the IDE in code by getting it from the application config file.
Hope this helps.

Howard

Reply via email to