New Posts New Posts RSS Feed: Set data source extension at runtime?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Set data source extension at runtime?

 Post Reply Post Reply
Author
mtx_kguil View Drop Down
Newbie
Newbie


Joined: 17-Aug-2009
Posts: 2
Post Options Post Options   Quote mtx_kguil Quote  Post ReplyReply Direct Link To This Post Topic: Set data source extension at runtime?
    Posted: 17-Aug-2009 at 1:46pm
Hello,

I am currently working on a application that requires access to two separate but identically structured databases.

From what I got out of the documentation it seems easy enough, just define the data source extension in the web.config, refer to it when creating the EntityManager, and add the appropriate .svc file.

cl = new DomainModelEntityManager(true, "Local");
cr = new DomainModelEntityManager(true, "Remote");

However, when I do this it always seems to use whichever data source extension that is defined in the Object Mapper.

Anyone have any suggestions?


Thanks,




Edited by mtx_kguil - 17-Aug-2009 at 1:49pm
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 18-Aug-2009 at 11:29am
Do you also have EdmKeys defined for each, in both the client app.config and the web.config?  The web.config needs the two EdmKeys, say "Default_Local" and "Default_Remote", so that it can obtain the correct database connection information; while the client app.config needs the two keys - with the same key names as used in the web.config - to both identify the data source and also the correct EntityServer service.
Back to Top
mtx_kguil View Drop Down
Newbie
Newbie


Joined: 17-Aug-2009
Posts: 2
Post Options Post Options   Quote mtx_kguil Quote  Post ReplyReply Direct Link To This Post Posted: 18-Aug-2009 at 12:51pm
Thanks for the reply Kimj,

Changing the name attributes of the edmKeys to "Default_Local" and "Default_Remote" (Instead of just "Local" and "Remote") did the trick!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down