I have developed an application that have a slider that showing some data from a
SQL Database. I’m using Visual Studio 2010 and Microsoft SQL Server 2008.
In fact i don’t face any problem with my application when i deploy it an run it on my Personal Computer.
The problem occurs when i try it on another machine, and the problem is that the application couldn’t be connected the SQL database. I tried to figure out the reason of the problem, so i tried it after its deployment on two machines, one of them have a SQL server installed on it, and the other one don’t have the SQL Server.
The Application worked perfectly on the machine that have the SQL Server installed on it, and it couldn’t be connected to the database on the other machine.
This is the Connection String i have used in my application>>
connectionString=”Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\KBank.mdf;Integrated
Security=True;User Instance=True”
so if there is a way that could enable me to run the application without needing the machine to have a SQL Server installed, i would be grateful. Thanks
You need to change the connection string to specify the computer the database is installed on. Something like the following:
Please note: The database on the other machine needs to be configured properly so it can be accessed from other machines.