I have this error: "1007 entity is not mapped" So I look in my edmx file and when I click "Validate", sure enough it says my two tables are not mapped to the database.
So I followed this: http://msdn.microsoft.com/en-us/library/bb738478%28v=vs.103%29.aspx to map entities to DB tables that already exist, but when I get to step 2, my drop list is empty instead of what their direction says: "The field becomes a drop-down list that contains all the tables in the storage model that are not already included in the current mapping."
Article provides no comments on how to fix it if it's empty. Good ole MSDN! I haven't found anything online either so far.
Anyone know this one?
Related
I work with Wonderware software. One of the objects used to perform communication between Wonderware and the PLC is called Suitelink. In it, I have a table defined that has the name of one of my application fields on the left side and the name of the PLC tag providing its value on the right.
Once this saved and activated (deployed) the PLC tags will feed values in the field attributes to Wonderware.
Does anyone know where is this list saved in the system?
I am working at a web page and want to retrieve this list dynamically so I can have the page updated based on the current live value of the PLC tag being used.
I have looked in the database but could not find it.
C:\ProgramData\Wonderware\DAServer
Then within there you'll have several subfolders for your DA Servers. Open the subfolder to find a *.AAcfg file and your contents are in there in what looks like an XML format. You'll be hunting for all the <DeviceItem> tags
I'm trying to integrate my Oracle Database into my ASP.NET app, but I keep getting this error :
Error 2002: The EntityContainer 'OracleDBTargetContainer' for the
storage model specified as part of this MSL does not exist in
MetadataWorkspace.
I've tried everything I could think of but still can't figure out what's wrong.
What can I do to diagnose the root cause of this?
This is still new to me so I might miss something very obvious.
I'm assuming it my not like my database as the Diagram displayed when I integrated another DB. I've checked the foreign keys, primary keys, ... but to no good.
Using VS2013 with ODP.NET 12c Release 3.
EDIT : My EntityContainerMapping is empty, is that normal?
<EntityContainerMapping CdmEntityContainer="PMModelContainer" StorageEntityContainer="PMModelTargetContainer"></EntityContainerMapping>
I found what was wrong.
One of my foreign key didn't match the primary key (Number 20 instead of Number 10)
I saw on stack overflow that it could be a problem and checked my tables but I missed that one obviously.
How did I realize it ? Well because rather than creating the EF Designer, I chose the Code First from database option, and, oh, what do you know, the error message now tells you EXACTLY what the problem is ! (Table names and columns).
Using Visual studio 2013 we are using the edmx feature to build the model based on the database.
Unfortunately when we update the model from the database some of the fields seem to have the number 1 added to their name.
For example the table in the database looks like this
But the model in visual studio is being created like this
How can I stop it adding the number 1 after the field name? This is happening in more than one table too.
I have tried regenerating the table on its own or the entire database and its not making any difference.
Ok so I think I have found out what the reason is.
If any of the tables in my database have the same name as the field name is where this issue is happening.
If you change the field name in the database then it should be fine. e.g the the example above change the field name from ClientTitle to ClientTitleName.
I am using propel orm as database abstraction layer.
I want to define different schema.xml files for diffenrent modules.
E.g. user.xml.schema for handling users and roles, or app.schema.xml for the application model.
My problem is, I want to reference to the user table of the user.schema.xml. I can handle this by the tag, but I want to use another table prefix for the user schema tables.
Running propel-gen creates two sql files (one for the user.schema and one for the app.schema), but the problem is, that the user-schema tables are generated twice. First with correct table prefix of the user schema file and the others with the prefix of the app schema file.
The foreign key also references to the wrong tables (that from the table with the prefix of the app.schema.xml).
I do not know any way to prevent this behaviour.
Any hints?
You cannot add different table prefixes to one database, and there is no way to add a tablePrefix attribute on the table tag. Let me explain a bit more, I know, you can specify a tablePrefix per XML schema even for a same database, but it leads to errors if you try to add relationship.. I don't know whether it's a bug or not, AFAIK the tablePrefix should be defined at the table level… Without relationship, you'll get a clean SQL file (or two if you don't set the propel.packageObjectModel build property to true.
You can read: http://www.propelorm.org/reference/schema.html. So I think, it's not possible to do what you would like to do unfortunately.
BTW, what you want to achieve is called multi component data model in the Propel doc.
I'm using an embedded relation to allow the user to edit/add books to a library and in the same form to add/remove n authors who wrote the book within the auto generated admin.
Here is my problem: An authors name is unique, so when I enter an author that already exists the sfValidatorDoctrineUnique produces the error.
An object with the same "name" already exist.
What I want to do is catch this error and tell the form not to try to add the exisiting author anew.
Do I use the event system for that, or modify the validators or how can I do that?
thank you very much
hoodie
PS:
after some searching I found something that might be a solution but I haven't made it work yet
http://symfonyguide.wordpress.com/2009/09/28/symfony-forms-saving-process/
I my opinion you should not to add new author if it already exists.
sfDoctrineActAsTaggablePlugin do the same way. It searches for an existing tags and merge them with current (added by user from form) tags.
But here is one issue: Two authors - Aleksander Pushkin and Alexander Pushkin, is it same authors for us, but different for machine.