I have a WCF service that is deployed on a machine. This WCF service can be configured to either SQL Server or SQL Server Express.
NOTE : The SQL database location can be other machine other then where WCF service is deployed.
I put following information in XML file:
- user id
- password
- ServerName
- MachineName
In case of SQL Server Express
The ServerName property is "SQLEXPRESS". Internally I append the ServerName with MachineName so the serverName is:
MachineName\SQLEXPRESS
which is passed to connection string.
In case of SQL Server
When I pass ServerName to SQL Server it throws exception.
Please guide me for the best approach!!