Getting "Problem in Mapping Fragment starting at line ..." error when trying to create table mappings for table associations in ADO.NET Entity Framework

 Table A: COUNTRY_LOOKUP

COUNTRY_ID   smallint

clustered, unique, primary key located on PRIMARY    COUNTRY_ID

TABLE B: COUNTRY_MODE_RULES

CARRIER_ID    int
MODE_RULE_TYPE_ID    int
ORIG_COUNTRY_ID    smallint
DEST_COUNTRY_ID    smallint

 clustered, unique, primary key located on PRIMARY    CARRIER_ID, MODE_RULE_TYPE_ID, ORIG_COUNTRY_ID, DEST_COUNTRY_ID

There is a foreign key relationship from COUNTRY_MODE_RULES to COUNTRY_LOOKUP

ORIG_COUNTRY_ID
REFERENCES .COUNTRY_LOOKUP (COUNTRY_ID)
DEST_COUNTRY_ID
REFERENCES COUNTRY_LOOKUP (COUNTRY_ID)

When using ADO.NET EF VS2008 Designer it automatically creates associations for the foreign key relationships. 

When trying to define the table mapping between these tables, I keep getting error "Problem in Mapping Fragment...COUNTRY_MODE_RULES is mapped to multiple conceptual side properties.

I know the problem happens because those ORIG_COUNTRY_ID and DEST_COUNTRY_ID fields are both scalar properties and navigation properties too. But I can't delete the scalar property because those fields are part of the primary key for the table. 

If any one has across this issue before, please let me know how you tried to solve it.

 Thanks,

0
temebele
2/25/2009 4:41:04 PM
asp.net.object-datasource 16182 articles. 0 followers. Follow

1 Replies
2168 Views

Similar Articles

[PageSpeed] 27

 Folks,

 I just deleted the table completely from the EF designer and deleted everything related to the table manually from the XML.

 I then added the table again and put the right mappings and it is now working without any problem.

 I think if the fields are primary key it doesn't cause problem to have them both in the navigation and property.

0
temebele
2/25/2009 7:54:28 PM
Reply:

Similar Artilces:

how to join existing table with table created by "create existing table"
"create existing table" can help to create a table which is linked to a sp select selection. but can this table be join to other physical tables? Yes, proxy tables can be used in joins. -bret ymho wrote: > "create existing table" can help to create a table which is > linked to a sp select selection. > but can this table be join to other physical tables? but i cant, pls refer my example below: create procedure po_t1 (@p1 char(8) ) as begin select ret_date=convert(datetime,@p1) end go CREATE EXISTING TABLE t1 (ret_out1 datetime not null, ...

VS.NET 2005 is ignoring in web.config strict="true". I get no error when I try this: Dim x As Integer = "string"
Hello,I have this in my VS.NET 2005 web.config <compilation debug="true" strict="true" explicit="true">When I do this in my vb code:Dim x As Integer = "string"I get no error. When I hit compilation I also get no error. What am I doing wrong?Thanks for helping!Regards,J. Bauer It's a bug of some sort See this response by Scott Guthriehttp://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3c1c9898-8076-4f69-a5e2-e99573d03c6e Unfortunately we don’t have a GUI based way to configure this. L It is something we will make sure gets added back in, though, with the next...

"activex component can t create object" error when trying to use .net dll in VB6
Hi everyone!I've writen a small .net class library to communicate with my web service to fetch some data from the database, etc,I have selected  "register for com interop" option, I added the reference to the vb6 project and everything works fine,but, when I deploy my whole project in another pc, I get  "activex component can t create object" error!I use a custom setup (using Inno setup) and register the type library file (tlb),which is copied to the vb6 exe's directory,I searched the registry and found the same registration entries in both pcs,so, what&...

oracle nested table problems and "create temporary table"
I have a few problems with nested tables. I could change the DBMS properties to have multiple nested table: create table table_1 ( column_1 my_nested_type, column_2 my_nested_type) nested table column_1 store as nested_table1 nested table column_1 store as nested_table2 1) When I modify the db and a temporary table is created to preserve the data, PWD doesn't generate the "nested table" clauses create table tmp_table_1 ( column_1 my_nested_type, column_2 my_nested_type) This is an invalid syntax for oracle. I don't find anywhere the way to change the scr...

Table "ENTRY" has no entry in the "ml_table" Table
Remote database: Ultralite Consolidated database: ASE 12 MobiLink server started with -v+, -zu+, -zac, -zec options The download succeeds. The upload fails because none of the upload tables are added to the ml_table table. If a different script version is used between the two steps (e.g., "ul_download" and "ul_upload") the tables from step 2 get added to the ml_table table, but no date is synched (even if there is data to be uploaded in the remote database) because no upload_cursor script is automatically generatred. What needs to be done to get this script ge...

The OLE DB provider "MSDAORA" for linked server "...." does not contain the table "COUNTRY". The table either does not exist or the current user does not have permissions on that table.
I am using SQL Server 2005 and trying to create a linked server on Oracle 10. I used the commands below: EXEC sp_addlinkedserver @server = 'test1', @srvproduct = 'Oracle', @provider = 'MSDAORA', @datasrc = 'testsource' exec sp_addlinkedsrvlogin @rmtsrvname = 'test1', @useself = 'false', @rmtuser='sp', @rmtpassword='sp'   When I execute select * from test1...COUNTRY I get the error. "The OLE DB provider "MSDAORA" for linked server "...." does not contain the table "COUNTRY". The table either does not exist or the current user does not have permissions on that table." The ...

mapping a drive using "net use" w/no password"
duplicate. -- Regards, Kai Reichert Novell Support Forums Sysop Usually the faulty interface lies between the chair and the keyboard. ...

Problem with editing "my maps" in Google maps
Running FF 23.0.1, Funnelcake Jul 2012, mozilla11 - 1.0 In Google maps, using "classic" version. Less than a week ago, when editing maps in Google maps (in "my places") I found that once I started locating place and marking them (adding "placemarks") that all the previous marks vanished from the display. They are still in the list, and when the map is opened again they all show again. I know Google maps updated some of its software about that time (to screams of pain from users in the forum), so I assume that something changed there, but things work...

mapping a drive using "net use" w/no password" #2
I want to set up a test scenario where I have a bunch of clients logging into a Netware server using native file access. My clients use a script file which maps shares to the server using the "net use \\server\share /p=no" (for no password). I keep getting "system error 5 - access is denied". What am I doing wrong and what can I do to fix it? Thanks for your help Assuming you're using Local mode, you must assign a Simple password. Note that a blank Simple password is not the same as never assigning a Simple password. bd NSC Voluntee...

I am trying to find .NET FrameWork class libraries and ADO.NET libraries maps to hang in my cube at work or at home.
Hello,    I am in search of the .NET Framework 1.x and 2.0 and 3.0 class library maps and ADO.NET class library maps to hang/pin to my cube at work and also at home. I believe that helps understand more about the Framework and also if some thing is presented in a pictorial representation I guess I can learn more than reading whole lot of stuff.   So is there a place on the net or any company that offers this to buy or down load?   Any inputs or help me finding on this is greately appreciated.   Thanks in advance, -L   The Visual Studio magazine use...

ADO.NET Table-Mapping
I roughly read thru ADO.NET Table-Mapping, but i dunno how to use it... For example, the code below is retrieved from http://msdn.microsoft.com/en-us/library/ms810286.aspx  SqlDataAdapter da = new SqlDataAdapter(...);DataSet ds = new DataSet();DataTableMapping dtm1, dtm2, dtm3;dtm1 = da.TableMappings.Add("Table", "Employees"); dtm2 = da.TableMappings.Add("Table1", "Products");dtm3 = da.TableMappings.Add("Table2", "Orders");da.Fill(ds); I understood when we wanna display, for example, 2 different columns from 2 di...

Retrograding httpHandler from .NET 2.0 to 1.1, get "Parser Error Message: Could not create type" message
Hi there,I have written a httpHandler using VS2005 and .NET 2.0 that builds and works fine.However, I am now having to convert it to .NET 1.1, which I hoped would just be a case of changing the runtime used by the web app (as in running the 1.1 version of aspnet_regiis, with a "-s" switch pointing at my web apps folder). After doing this though (and fixing a few minor differences with web.config), if I then navigate to my handler I get the following error message:Server Error in '/Path/To/MyWebApp' Application.Parser ErrorDescription: An error occurred during the parsing of...

Developed C#.net WebService 1.1 for Client C#.net 1.1. Getting error "Server was unable to process the Request" Pls Help
Hi., I developed Microsoft C#.net Web Services2003 for the Client Application C#.net 2003. When it runs in 5 machines it gives good performance and has no errors. But if i run the same application in about 80 client machines. Getting error "Server was unable to process the request". I use Sql Server 2005 as my database. I get error even when i login at a time for about 25 users. Tried modifying machine.config too. But went unsuccessful. Live Server is 2003 using IIS 6.0 I use very expensive data handling.  Its very urgent pls help. Have to post in Live Server. Thank u., ...

Error with "CREATE EXISTING TABLE"
I create a series of proxy tables in an ASA 9.02.3274 server for Mobilink synchronization purposes. One table fails to be created when the source database server is Oracle with an error referencing "SYS_NC00010$". Googling that string lead me to an index that is on that table; the index contains LTRIM and RTRIM functions. When I remove that index the proxy table is created with no trouble. Below is the format of the statement I use. NOTE: DSN_DB_REPLACEMENT is a placeholder for the source server data - it is replaced with a batch file becase we have to support MS...

Web resources about - Getting "Problem in Mapping Fragment starting at line ..." error when trying to create table mappings for table associations in ADO.NET Entity Framework - asp.net.object-datasource

Resources last updated: 1/10/2016 1:51:44 AM