user1569367
user1569367

Reputation: 93

Silverlight RIA Application can not be connected to Database while Deploying

I have developed a Silverlight RIA application.Now i am trying to deploy it to the local IIS7 but with a remote SQL database.After i deployed,the application is working but it can not connect to the SQL server.I have generated the schema and the data to the remote SQL server..but the app can not connect to the SQL server.

In the web.config the specified connection string is :

 <connectionStrings>
<add name="IspahaniAgroLTDEntities" connectionString="metadata=res://*/AgroModel.csdl|res://*/AgroModel.ssdl|res://*/AgroModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SqlExpress;initial catalog=NewLocalDataBase;inut it's tegrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

I have tried to replace the connection string from web.debug.config & web.release.config like ASP.NET but it's not working like that.Can anyone please tell me how can i change the connection string to the new SQL server while deploying.

Thanks

Upvotes: 1

Views: 523

Answers (1)

Chui Tey
Chui Tey

Reputation: 5584

Don't use Integrated Security. That is usually useful for development scenarios. Set the user id and password instead.

 connectionString="
    metadata=res://*/AgroModel.csdl|res://*/AgroModel.ssdl|res://*/AgroModel.msl;
    provider=System.Data.SqlClient;
    provider connection string=&quot;
      data source=YOUR_DBSERVER;
      initial catalog=YOUR_DBNAME;
      user id=YOUR_USER;
      password=YOUR_PASSWORD;
      multipleactiveresultsets=True;
      App=EntityFramework&quot;" 

The reason is the remote IIS is configured to run as a user who doesn't have rights to the SQL Server.

Upvotes: 1

Related Questions