My Visual Studio .NET application uses SQL Server 2005 Express.
It has to be installed on my customer's main server system & on two client computers.all with Windows XP or Vista or 7.
Now, every time when i install my application & SQL Server on my customers computers, I have to change the server name specified in the connection string, i.e. the DATA SOURCE. Because, when I install SQL Server on customer's computer, then the server name is taken by SQL Server 2005 Express, as the computer name of the customer.
So, what's the solution for this?
- Shall I change the computer name of the customer, to what i have specified in my connection string.
- or , should i take the server name dynamically on runtime from the .net application and then pass it to the connection string.
Also, the same problem is for login? My .NET application would ask for the login & password from the customer, which would then be passed to the connection string & the application would connect to SQL Server. So, is this ok with security? if not, then what's the other solution to create logins of SQL Server from the .NET application dynamically.
Also, should i create APPLICATION ROLES for this purpose , i.e. for solving the login problem?
My connection string is : Data Source = A-9 (computer name) ; Trusted_Connection = true;
----------------------------------------------EDITED---------------------------------------
At my customer's place,'APP_SVR' is server machine name, he has 2 client m/cs : C-1 & C-2. All 3 are simple home PCs on LAN, with Windows XP.
1.I will install SQL SERVER EXPRESS on 'APP_SVR'. While installation, SQL SERVER automatically takes the server name as the computer name on which it is installed , here it is 'APP_SVR'. So , 'APP_SVR' will be the DATA SOURCE NAME in the conn. string.
2.I will install the .NET application on C-1,C-2.
3.Now, the application on C-1,C-2 will have to connect to SQL SERVER on 'APP_SVR'.
For this,the applcn. needs DATA SOURCE NAME. So, I would take the data source name from
users using C-1 & C-2, as a text input & then pass it to the connection string.
The users would enter it as 'APP_SVR'.
Would this be fine with security issues ? or is there any other way?