HOW TO: Build a Connection String Programmatically

D

_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.aspx?scid=kb;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?
 
M

Miha Markic [MVP C#]

Hi,

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

_DS

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
 
M

Miha Markic [MVP C#]

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top