Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entity Framework Problem
Message
From
09/07/2009 10:52:55
 
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
Database:
MS SQL Server
Miscellaneous
Thread ID:
01411147
Message ID:
01411158
Views:
62
>Hi,
>
>I'm using the Entity Framework to access a local SQLServer database with a bunch of methods using the ObjectContext as generated by the designer.
>
>I'd like to be able to use the same methods against an ObjectContext generated from an identical database on a different server but can't see how it can be done.
>
>Is it possible? Any suggestions?
>TIA,
>Viv

It's been some time, but I did try this a couple of months ago and never quite figured it out. What I did learn at that time is that you cannot change the connection string once the first connection has been done in objectcontext. I could only create a connection by creating an entirely new instance of the objectcontext and I had to let go the entities first. I also ran into problems when the objectcontext went out of scope because the disposing of the objectcontext happens but the database connection didn't close. I had to clear all connections manually. Had something to do with pooling and I think it can be turned off if I remember correctly. If you want, I can look for my code but you're probably further along than I ever got with it.

I never got past that I am interested if you learn of a way to do it. I was working with the entity framework for my own research, not for work so I didn't have a lot of time to work on it.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform