Reputation: 630
I make a program , using c# and sql server with sql authentication , It works properly in my device , but after making the program setup file .exe extension using Innosetup , i cannot connect to my database , what I've tried is exporting my database in script , and run the script on another device , but it does not work , I think I need to create port or something to connect to this database , or in my app.config change the server name
Here is my connctoin string
<connectionStrings>
<add name="MarketDatabaseEntities" connectionString="metadata=res://*/AmanjCenter2Entity.csdl|res://*/AmanjCenter2Entity.ssdl|res://*/AmanjCenter2Entity.msl;provider=System.Data.SqlClient;provider connection string="data source=RABAR;initial catalog=MarketDatabase;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
Upvotes: 0
Views: 344
Reputation: 3276
I see two points of failure here:
Data source: Data source name is machine name. Is your target machine name "RABAR"? I guess not. If your database is installed on that machine, you can change data source to data source = (local)
.
Integrated Security: You have set Integrated Security = true
. This causes problem on target machine because you will have to configure SQL Server user and windows user accordingly. Instead of that trouble you can create a SQL Server user and configure your connection string that way i.e User Id = [SQL Server User]; password = SQL Server User's password
.
HTH
Upvotes: 2