This is a migrated thread and some comments may be shown as answers.

[Solved] Can't update database from model

9 Answers 274 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gordon Buxton
Top achievements
Rank 1
Gordon Buxton asked on 03 Aug 2010, 11:13 AM
Hi,

I have set up a brand new project using the 2010.2.714 ORM release, and I'm having trouble producing an update script from my model.

My steps were:

1. Set up a new project (Namespace: Oxinet.PEMS.DataModel)
2. Create a new data model called PEMSData
3. Import from existing database, which is still being designed, so most of the tables are there, but not all the mapping tables
(what I was hoping that we could use ORM to create "glue" mapping tables for us).
4. Make a few changes to property names, and make a couple of associations which involve the creation of new mapping tables.
5. This seems to work ok and creates some nice partial classes from my original database tables, one of which is called "Person"
6. Try to do "update database from model", where I go through the wizard and it just pops up with "Could not load type Oxinet.PEMS.DataModel.Person. Please rebuild the project and run the wizard again."
so (duh!) I rebuilt the project and ran the wizard again and I get the same result. I have no build errors or even any warnings.

What am I doing wrong?

9 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 05 Aug 2010, 05:41 PM
Hi Gordon Buxton,

This error message is most probably shown due to the fact that Telerik OpenAccess is unable to load a specific type. In this case there is a cached Database instance which metadata is not refreshed with the latest changes made from the designer.
There are two methods you could try to avoid this issue:
1. Change the connection string in order to obtain a new Database instance which OpenAccess will work internally with;
2. Restart Visual Studio;
At last you should rebuild your project before running the Update Schema from Model wizard.
Hope that helps.

Kind regards,
Damyan Bogoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Brent
Top achievements
Rank 1
answered on 28 Aug 2010, 09:39 PM
Hello,
  I am having this same issue.  I commented out the connection string in app.config, have tried cleaning the solution, rebuilding and restarting visual studio.  Nothing seems to work for forward mapping.

I am also using the express license for evaluation version 2010.2.714

Brent
0
PetarP
Telerik team
answered on 30 Aug 2010, 09:07 AM
Hello Brent,

 When you close your visual studio instance can you please open the solution folder and delete all compiled assemblies manually before opening the visual studio again. This should fix your problem. Please note that you will have to rebuild your project once you open your solution again. We have eliminated the need of a compiled assembly from the forward mapping wizard and you should not encounter such problems in our next versions.
We are sorry for any inconvenience caused.

Greetings,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
George
Top achievements
Rank 1
answered on 30 Aug 2010, 05:31 PM
Petar,

Your suggestion appears to have no impact.  I cannot use the function at all.  I removed all assembly references and restarted VS and rebuilt.  I still receive the Please rebuild the project in order to advance to the next step message.  I also tried with the 2010.2.804 internal build.  Same result.

Can you guys maybe put a new internal build for us to try?

Thanks, Greg
0
Brent
Top achievements
Rank 1
answered on 30 Aug 2010, 08:25 PM
This solution did work for me.  I manually deleted all Bin and Obj folders and then rebuilt my solution and I was able to generate a script where I was not before.

Brent
0
PetarP
Telerik team
answered on 02 Sep 2010, 03:34 PM
Hello Greg and Brent,

 We are still working on the improved version of the forward mapping wizard. What we are targeting is to completely remove the need of a compiled assembly for the wizard to run. This will greatly ease the work with the wizard and dramatically reduce the problems that are present now. I will post here once we have an internal build containing the new version.
Once again sorry for the inconvenience caused.

All the best,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
IT Department
Top achievements
Rank 1
answered on 20 Oct 2010, 06:33 PM
Any updates on this issue?
0
PetarP
Telerik team
answered on 22 Oct 2010, 04:26 PM
Hello Vladimir ,

 Our latest internal build tcontains the fixes. You no longer need the pre-compiled assembly and thus you should not encounter the same problem again.

Greetings,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
George
Top achievements
Rank 1
answered on 22 Oct 2010, 04:28 PM
Hi Petar,

Great news, and great work.  I'll take it for a spin today!  :)

Thanks, Greg
Tags
General Discussions
Asked by
Gordon Buxton
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Brent
Top achievements
Rank 1
PetarP
Telerik team
George
Top achievements
Rank 1
IT Department
Top achievements
Rank 1
Share this question
or