?
Solved

C#.NET FORMS DSN Dialog Box

Posted on 2012-08-15
6
Medium Priority
?
982 Views
Last Modified: 2012-09-06
Greetings...
I am wanting to select a DSN from the ODBC Data Sources so a user can select, create, or update a DSN and then populate the chosen DSN to a Textbox to be used later on.


Example Form
Any wisdom would be graciously appreciated.
Thank you.
0
Comment
Question by:Evan Cutler
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 38300390
That depends on what type of DSN that you want.  

1) You can find the System DSN names in the registry under the HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI key.

2) User DSNs are listed in the ODBC.INI file in the %SystemRoot% folder (i.e. C:\Windows)

3) File DSNs are in the C:\Program Files\Common Files\ODBC\Data Sources folder.
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 38300608
So, If they don't want any of those, I can set a button to create one by executing the ODBC Data Sources program?  then requery?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 38300696
You can run Control Panel applets from code, by adding a COM reference to the  'Microsoft Shell Controls and Automation type library.

The Shell32.Shell class has the ControlPanelItem method that takes the name of an applet (i.e. ODBC.cpl).  

The following is an example list of applet names:

            Accessibility
            AddHardware
            ApplicationManager
            AutomaticUpdates
            Desktop
            Drivers
            Internet
            Joystick
            Main
            MicrosoftMail
            NetwareClient
            NetworkSetup
            ODBC
            PowerManagement
            RegionalSettings
            SecurityCenter
            System
            Telephony
            TimeDate
            UserManager
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
LVL 31

Expert Comment

by:MlandaT
ID: 38304246
You have several options. Try them out and choose what works best for you:

1. DataLinks Library
http://www.codeproject.com/Articles/6080/Using-DataLinks-to-get-or-edit-a-connection-string

2. Microsoft.Data.ConnectionUI (UI used by Visual Studio)
http://www.codeproject.com/Articles/21186/SQL-Connection-Dialog

3. UDL.NET (Custom Solution)
http://www.codeproject.com/Articles/59796/UDL-Net-A-ConnectionString-Editor-Built-from-Scrat
0
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 38316047
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 38322158
I basically had to make a call.
Press button get Administrator...app will close...
It was the only way I could keep the workflow where it needed to be.

Thanks for the input.
Evan
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ready to get certified? Check out some courses that help you prepare for third-party exams.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question