Thoughts from Dan Miser RSS 2.0
 Tuesday, August 22, 2006
I have a need to allow users to build up a connection string and store it in a config file. Pretty simple need, and I would imagine rather standard. After all, I can't imagine any user I deploy to would have the same connection string I do, much less the same database. As it turns out, providing a robust piece of code to get this done will have to be all custom code. Given how common this scenario is, I'm more than a bit disappointed that MS just punted on this entire thing. Do they really expect end users to just wander around and edit config file XML syntax by hand and get it right? Do they really think not having the ability to do a "Test Connection" is a good idea?

I know about the support article from MS, but that uses interop back to plain ADO. I really can't believe they would not provide a managed code alternative that works with ADO.NET. Furthermore, the DbConnectionStringBuilder class in ADO.NET 2.0 starts to solve the problem, but stops short, like Frank Costanza on a drive through New York City. That class gives us some capability to build up the connection string, but none to visually build it up, much less edit a connection string in-place in the config file.

After way more time searching around the Internet than I care to admit, I'd like to think that I'm missing some simple link, but it looks like MS expects every single .NET developer to implement their own Connection String Wizard from scratch. Feel free to reply if you know of any pre-built solutions.

Tuesday, August 22, 2006 9:14:00 AM (Central Standard Time, UTC-06:00)  #    Comments [4] -
ADO.NET
Tracked by:
http://9nv-information.info/79588743/index.html [Pingback]
http://9nt-information.info/27541873/index.html [Pingback]
http://9nl-information.info/73570560/index.html [Pingback]
http://9nh-information.info/25802720/index.html [Pingback]
http://9nd-information.info/74876339/index.html [Pingback]
http://9nr-information.info/85024707/index.html [Pingback]
http://9ne-information.info/29509432/index.html [Pingback]
http://9nu-information.info/02964477/index.html [Pingback]
http://9nu-information.info/64533197/newly-published-children-chapter-books.html [Pingback]
http://9nc-information.info/83467584/robin-quivers-home-page.html [Pingback]
http://9nd-information.info/03595011/index.html [Pingback]
http://9ny-information.info/52231278/index.html [Pingback]
http://9ns-information.info/31999468/index.html [Pingback]
http://9ok-information.info/89913286/casting-in-computer-science.html [Pingback]
http://9qc-information.info/46341676/index.html [Pingback]
http://9qs-information.info/72128424/ferro-genova.html [Pingback]
http://9oh-information.info/71771143/installing-office-2004-upgrade.html [Pingback]
http://9op-information.info/80340529/party-of-five-show.html [Pingback]
http://9qb-information.info/56409509/edad-media.html [Pingback]
http://9rl-information.info/01534824/index.html [Pingback]
http://9sl-information.info/05057134/index.html [Pingback]
http://9rm-information.info/03165522/index.html [Pingback]
http://9rj-information.info/83747497/index.html [Pingback]
http://9sf-information.info/07907162/index.html [Pingback]
http://9rb-information.info/49547515/index.html [Pingback]
http://9so-information.info/60578951/index.html [Pingback]
http://9sj-information.info/09540786/mp3-1-5gb.html [Pingback]
http://9uaer-le-informazioni.info/46454195/index.html [Pingback]
http://9uaef-le-informazioni.info/07882252/social-security-card-request.html [Pingback]
http://9uafj-le-informazioni.info/83235836/ikarus-super-star-plans.html [Pingback]
http://9uael-le-informazioni.info/68171057/index.html [Pingback]
http://9uaeb-le-informazioni.info/29844801/ospedale-civile-pescara-neurochirugia... [Pingback]
http://9uafk-le-informazioni.info/66599022/monsampolo-del-tronto.html [Pingback]
http://9uaed-le-informazioni.info/54297642/cerchi-borrani.html [Pingback]
http://9uaeo-le-informazioni.info/49844467/index.html [Pingback]
http://9uaeh-le-informazioni.info/59538465/acrobat-reade.html [Pingback]
http://9uagp-le-informazioni.info/99119305/index.html [Pingback]
http://9uagi-le-informazioni.info/43210576/index.html [Pingback]
http://9uahq-le-informazioni.info/41295239/index.html [Pingback]
http://9uahi-le-informazioni.info/32882370/index.html [Pingback]
http://9uahc-le-informazioni.info/45332730/index.html [Pingback]
http://9uagq-le-informazioni.info/49693521/janeth.html [Pingback]
http://9uage-le-informazioni.info/52338054/index.html [Pingback]
http://9uagh-le-informazioni.info/80632929/capri-vendo-casa.html [Pingback]
http://www.google.com/search?q=skaqdyey [Pingback]
Tuesday, August 22, 2006 10:55:00 AM (Central Standard Time, UTC-06:00)
Generally, I use the "File Name=c:\myprogramlocation\MyUdl.udl" method of connection string and keep the settings there. Durring my install process, I generate the udl from information gained from the setup program. This gives me the ability to check/change the connection just by double clicking the udl file. I use Inno for my setup and have a few custom screens generated to handle most of the cases we have run into (installing to MSSQL).



Of course this isn't exactly what you were probably looking for...but it works. Most of the time the person doing the initial install is going to be the system admin, so our method of asking for the connection data at initial setup works for us.
Steven Kamradt
Tuesday, August 22, 2006 2:53:00 PM (Central Standard Time, UTC-06:00)
Hi Dan,

If I understand what you mean, there's a very simple, as much as obscure and little known, way of invoking the standard MS Wizard: just programmatically create an empty .udl file and execute it, and voilà, the user can build his string, and the .udl gets filled with the connection data.



Hope this helps!



--Giulio
Giulio Palmieri
Thursday, August 24, 2006 9:39:00 AM (Central Standard Time, UTC-06:00)
I'll check into the udl approach. I used it for vanilla ADO way back when, so that may be a real good compromise. Thanks.
Thursday, August 24, 2006 1:11:00 PM (Central Standard Time, UTC-06:00)
I just tested creating an empty .UDL file, and it works really well. Thanks Giulio!
Ken White
Comments are closed.
Navigation
Archive
<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Dan Miser
Sign In
Statistics
Total Posts: 310
This Year: 25
This Month: 1
This Week: 0
Comments: 605
All Content © 2008, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)