Solved

LINQ to Entity - Update from Database/Alternative

Posted on 2011-02-28
9
705 Views
Last Modified: 2013-11-11
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.
0
Comment
Question by:Masterabhi
  • 4
  • 2
9 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 35004000
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
0
 

Author Comment

by:Masterabhi
ID: 35010433
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?
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 35010837
The EDMX is a strongly typed model so in order to update it to the updated structure of the database you need to recompile the program after manually updating the EDMX.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:Masterabhi
ID: 35109969
Does that mean, there is no way I can update my model automatically?
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 35110034
Correct.
0
 
LVL 5

Expert Comment

by:knowlton
ID: 36115939
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.
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 36115940
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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now