Author |
Topic |
jimmyray
Starting Member
4 Posts |
Posted - 2009-12-23 : 16:46:37
|
Hi,I have created an application with Visual Studio 2005 and have it installed on my pc. I am using SQL Server 2005 and think I am missing something. When I tyr to login to my application it gives me an error...The connection to the database can't be established.Can anyone help? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
jimmyray
Starting Member
4 Posts |
Posted - 2009-12-23 : 17:28:23
|
Yeah, I can login through the management studio. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
jimmyray
Starting Member
4 Posts |
Posted - 2009-12-28 : 12:01:42
|
Ok here is my connection string. Not sure what i am doing wrong. Like I said...I am new at this.<add name="ARS.My.MySettings.ARSConnectionString" connectionString="Data Source=(local);Initial Catalog=ARSSRV;Integrated Security=SSPI" providerName="System.Data.SqlClient" />ARSSRV is on server MANI-PC\SQLEXPRESS |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2009-12-28 : 13:09:46
|
If the main server is different from the PC u installed it on, then you have to change your connection string to non trusted and put a username and password.also change the data source from local to the server address.see this www.connectionstrings.com Also in Vstudio, did you add database or add connection ??? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2009-12-28 : 14:02:52
|
If you added a db, then you shouldnt have a problem.But if it was an external source then you have to modify it |
 |
|
jimmyray
Starting Member
4 Posts |
Posted - 2009-12-28 : 14:40:22
|
Awesome that worked. Thanks! So that makes it work on my pc. How would i get it to work on a client pc after my program is installed?? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2009-12-28 : 19:01:48
|
If you are using winforms, put your connection string in a central location in your app.config file.If you are using WPF, put the connection string in the resources settings.Then where ever you have to set a data connection in your program, make a variable reference to it using ADO.NET |
 |
|
|