Link to home
Start Free TrialLog in
Avatar of Mohammad Aamir Qureshi
Mohammad Aamir QureshiFlag for Australia

asked on

SQL SERVER Name

AOA

Hello Every body hope u all are fine

My Question is simple hoe can i dynamically pick the sql server name in connection string

Thankx
Avatar of 2266180
2266180
Flag of United States of America image

well, that depends on your implementation:

you create a new connection like new SqlConnection(constring);

and you construct constring as you wish :) (from UI, from a configuration fiel, etc)
Avatar of Mohammad Aamir Qureshi

ASKER

AOA

Thankx for ur quick response

i want to pick dunamically sql server name in my SQL COnnection

thankx
Hi ciuly,

When you say pick dynamically, how? - Do you want to type in the server name in your front end that you want to use, do you want a dropdown list of servers to choose from (if so, do you have this list defined somewhere)?

Should have said "hi Aamirg", not  "Hi ciuly" :)
i think there is still comfusing is my question may b i cant explain

Explanation of Question

the Connection string is

string connectionString = "Data Source=TMANAGER; Initial Catalog=NBP; Integrated security=SSPI;";

Here the Datasource is our Computer as well as SQL SERVER 2000 name

i want to pick dynamically in my connectionstring through coding in C# because every computer have different server name

i think this is enough

Thankx
ASKER CERTIFIED SOLUTION
Avatar of 2266180
2266180
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
AOA

thank u ciuly

this code is exact what i want

once again thanks