Print Page | Close Window

Set data source extension at runtime?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1427
Printed Date: 01-Sep-2025 at 1:52am


Topic: Set data source extension at runtime?
Posted By: mtx_kguil
Subject: Set data source extension at runtime?
Date 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,

file:///C:%5CUsers%5Ckyleg%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml -
-




Replies:
Posted By: kimj
Date 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.


Posted By: mtx_kguil
Date 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!



Print Page | Close Window