471,319 Members | 3,224 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

HOW TO: Build a Connection String Programmatically

_DS
There is an article on MSDN called: "HOW TO: Build a Connection String
Programmatically in ADO.NET by Using Visual C# .NET"
http://support.microsoft.com/default...b;EN-US;310083

The article outlines adding refs to MSDASC and adodb to a project in
order to interactively generate and test a db connect string.

I can't imagine that VS2005 would still be ref'ing older com modules
for this. What is the new function?

Jan 17 '06 #1
3 6974
Hi,

there is a DbConnectionStringBuilder base class in .net 2.
Database specific classes inherit from it, such as
SqlConnectionStringBuilder class.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"_DS" <_D*@Nospamforme.com> wrote in message
news:vp********************************@4ax.com...
There is an article on MSDN called: "HOW TO: Build a Connection String
Programmatically in ADO.NET by Using Visual C# .NET"
http://support.microsoft.com/default...b;EN-US;310083

The article outlines adding refs to MSDASC and adodb to a project in
order to interactively generate and test a db connect string.

I can't imagine that VS2005 would still be ref'ing older com modules
for this. What is the new function?

Jan 17 '06 #2
_DS
On Tue, 17 Jan 2006 10:51:24 +0100, "Miha Markic [MVP C#]" <miha at
rthand com> wrote:
Hi,

there is a DbConnectionStringBuilder base class in .net 2.
Database specific classes inherit from it, such as
SqlConnectionStringBuilder class.


That's part 2 of what I was trying to recall, but that's the
string-cat function that assembles the string after individual
components are formed. (I had actually written a class that
did that, pre-VS2005)

The main function that I was looking for is similar to VS2005's
built-in "Add/Modify Connection Dialog Box" but done programmatically.
In other words, the user of my program would have the equivalent of
the Visual Studio Connection Wizard.

Again, I had done this with VS2003 by using the COM module that I had
mentioned, but I do believe there is a .NET version now. That would
be nice, as VS2005 does not like the COM module much.

....and probably
Jan 18 '06 #3
Ah, I see.
I don't think that there is anything like that (UI) out of the box but
nothing prevents you from updating your existing code...(mostly you would
have to comment it out)

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"_DS" <_D*@Nospamforme.com> wrote in message
news:qn********************************@4ax.com...
On Tue, 17 Jan 2006 10:51:24 +0100, "Miha Markic [MVP C#]" <miha at
rthand com> wrote:
Hi,

there is a DbConnectionStringBuilder base class in .net 2.
Database specific classes inherit from it, such as
SqlConnectionStringBuilder class.


That's part 2 of what I was trying to recall, but that's the
string-cat function that assembles the string after individual
components are formed. (I had actually written a class that
did that, pre-VS2005)

The main function that I was looking for is similar to VS2005's
built-in "Add/Modify Connection Dialog Box" but done programmatically.
In other words, the user of my program would have the equivalent of
the Visual Studio Connection Wizard.

Again, I had done this with VS2003 by using the COM module that I had
mentioned, but I do believe there is a .NET version now. That would
be nice, as VS2005 does not like the COM module much.

...and probably

Jan 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Douglas Buchanan | last post: by
4 posts views Thread by Bob Garbados | last post: by
5 posts views Thread by Zlatko Matić | last post: by
4 posts views Thread by sydney.luu | last post: by

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.