Skip to main content
Home Forums Silverlight Programming WCF RIA Services cannot make a Dynamic ConnectionString using ria.
4 replies. Latest Post by Wigen on November 6, 2009.
(0)
Wigen
Member
3 points
16 Posts
11-03-2009 6:33 PM |
The question i have is.. How do i make a dynamic connection string using RIA?
I am able to change the context inside of ria and pass it a database name to connect to, this only works when getting the information, i cannot run "submitchanges" as it will look at the original context instead of the one i changed.
Say i have a database of printers for 1 store that is called "printers"
then store 2 is "printers2"
without changing the webconfig how can i get ria to change connection strings? we have a database that stores database names that is across all stores so that is how i would be able to know what the database name is i want to connect to.
thanks!
bryant
Star
9937 points
1,629 Posts
11-03-2009 6:36 PM |
You would probably need to add some custom logic in your Update method to update the proper database based on the object being updated. This would need to happen in the service.
11-03-2009 7:11 PM |
How could i do that? i tried adding a parameter in the Update method and it gave me an error where i wasnt able to make it anything else than having 1 parameter.
11-04-2009 4:14 PM |
Can you post a sample of the update method that won't work?
11-06-2009 12:53 PM |
I understand now, I made a new update method that got the item that is being updated and passed the connection string. then did a savechanges on the service and it worked. Thanks!