Solved

LINQ to Entity - Update from Database/Alternative

Posted on 2011-02-28
9
703 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

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

Expert Comment

by:Fernando Soto
Comment Utility
Correct.
0
 
LVL 5

Expert Comment

by:knowlton
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

12 Experts available now in Live!

Get 1:1 Help Now