Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

i want to make a SQL Connection dialog in my application for users to giving them ability to connect to different Databases regarding their need on application start.


You quick response in this regard will be highly appreciated.


Regards,

Aamir
Posted

1 solution

Need more details. What kind of an app is it? c#, vb.net. asp.net, wpf etc?

Just having a form popup with a dropdown list full of various connection strings is what you are looking for I guess.

Okay. Assuming that you have a set of databases for which you have all the information already. Then you can make an XML file with that data. Like this...

XML
<?xml version="1.0"?>
<DataBase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Node>
        <Server value="gdms-dolphin" />
        <DB value="BioStar" />
        <User value="sa" />
        <Location value="Los Angeles" />
        <SMTPServer value="Exchange" />
        <EmailID value="johnsmith@gmail.com" />
        <Password value="password" />
    </Node>
    <Node>
        <Server value="gdms-orca" />
        <DB value="BioMoon" />
        <User value="sa" />
        <Location value="Newyork" />
        <SMTPServer value="Exchange" />
        <EmailID value="johndoe@gmail.com" />
        <Password value="password" />
    </Node>
</DataBase>



Then just read the XML and populate the form. To do it, just google how to populate controls from XML file. Should be simple.

Also I am guessing your server field should be a dropdown and selecting a server in it should accordingly populate the rest of the fields. This can be done on the selection change event of the dropdown list; again very easy in winform.

Good luck.

[Please encourage participation by up-voting solutions or answers that work for you]
 
Share this answer
 
v2
Comments
Aamirabdullah 3-Feb-14 6:36am    
Dear sir,
It is Vb.net Application
Yes you are right about what you said about popup aslo kindly clink on the link of pic below to see what is want to explain

http://tinypic.com/r/210ccxz/8
CoderPanda 3-Feb-14 6:50am    
Updated the original answer as the reply feature doesn't allow me to put XML in it.
Aamirabdullah 3-Feb-14 7:28am    
thanks for your quick answer in this regard,

i will check you solution and let u know and i will be very tankful to u if you show me the process step by step and kindly also give me the links of some useful tutorials site regarding building business applications.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900