Mohammad Aamir Qureshi
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
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
ASKER
AOA
Thankx for ur quick response
i want to pick dunamically sql server name in my SQL COnnection
thankx
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)?
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" :)
ASKER
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
AOA
thank u ciuly
this code is exact what i want
once again thanks
thank u ciuly
this code is exact what i want
once again thanks
you create a new connection like new SqlConnection(constring);
and you construct constring as you wish :) (from UI, from a configuration fiel, etc)