Home All Groups Group Topic Archive Search About

HOW TO: Build a Connection String Programmatically

Author
17 Jan 2006 8:36 AM
_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?

Author
17 Jan 2006 9:51 AM
Miha Markic [MVP C#]
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/

Show quote
"_DS" <_DS@Nospamforme.com> wrote in message
news:vpaps11726udni1dudgs0u1p8dbvj4uqj6@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.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?
>
Author
18 Jan 2006 9:53 AM
_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
Author
18 Jan 2006 10:33 AM
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)

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

Show quote
"_DS" <_DS@Nospamforme.com> wrote in message
news:qn2ss1hc9sundkgsbhruib1o733p5g6bkb@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

AddThis Social Bookmark Button