I have multiple SQL Server databases with the same schema. I would like to use one WCF data service (Rest service) to access the different databases.
How can I accomplish this so the client can pass in the correct database name or connection string?
I have multiple SQL Server databases with the same schema. I would like to use one WCF data service (Rest service) to access the different databases.
How can I accomplish this so the client can pass in the correct database name or connection string?
You could define some query string parameters, something like:
http://YourServer/YourService/SomeUrl?database=MyDatabase1
and then in your server-side code, use that database=MyDatabase1 to dynamically build the connection string, that you then use to open a connection to the database. Shouldn't be too hard, I think!