Link to home
Start Free TrialLog in
Avatar of Masterabhi
Masterabhi

asked on

LINQ to Entity - Update from Database/Alternative

I am using the LINQ to Entity framework with VS 2010(C#). But there is a issue that every time database gets updated, I have to go and manually update edmx file from database. It is a running windows service, therefore it can crash the application.  Is there any other way that edmx file can be updated automatically or I have to use Entity framework without using edmx file but create some edmx conceptual look alike file and run query and stored procedures using sql.
Please help.
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Hi Masterabhi;

I have never tried this before and so I ran a couple of test. I added and extra column to the database table and my test program ran the query with no problem. I then moved a column in the table and ran the program again and it still ran with no problem.

So what do your queries look like? Can you post then? Where does the program crash?

As far as keeping the model in sync with the database you will need to update the model through the designer.

Fernando
Avatar of Masterabhi
Masterabhi

ASKER

I want to get my .edmx  updated automatically whenever there is a change in database.
I have a running windows service which uses linq to enitity to access data from database.
So if there is a change in database, in this case I have to stop the service , go into my code, and do update the model from database in my edmx file to keep this file in synch with database changes.
I don't want to stop my service in the middle, whenever there is a change in database.
Is this possible to do?
Is there any other alternative I can use?
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Does that mean, there is no way I can update my model automatically?
Correct.
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Hi Moderator;

Please note that this question has been answered. Please look at the last two post. Seeming that the question has been answered the points should be awarded.

Thanks;
Fernando