Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 7 Oct 2008 19:30:00 -0700,    group: microsoft.public.dotnet.framework.adonet        back       


Error 3033: Problem in mapping fragment   
Hi,

I am trying to follow the How to: Define a model with single entity mapped 
to two tables, but I am getting the following error as I validate the model:

EntitySets 'Store' and 'Customer' are both mapped to table 'Customer'. Their 
primary keys may collide.

the mapping xml for the Store EntitySet is like so:


<EntitySetMapping Name="Store">
            <EntityTypeMapping TypeName="IsTypeOf(AdventureWorksModel.Store)">
              <MappingFragment StoreEntitySet="Customer">
                <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
                <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
                <ScalarProperty Name="AccountNumber" 
ColumnName="AccountNumber" />
                <ScalarProperty Name="CustomerType" 
ColumnName="CustomerType" />
                <ScalarProperty Name="Cust_rowguid" ColumnName="rowguid" />
                <ScalarProperty Name="Cust_ModifiedDate" 
ColumnName="ModifiedDate" />
              </MappingFragment>
              <MappingFragment StoreEntitySet="Store">
                <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
                <ScalarProperty Name="Name" ColumnName="Name" />
                <ScalarProperty Name="Demographics" 
ColumnName="Demographics" />
                <ScalarProperty Name="rowguid" ColumnName="rowguid" />
                <ScalarProperty Name="ModifiedDate" 
ColumnName="ModifiedDate" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
------------

What could be happening? I don't see that Store is mapped to Customer???
-- 
Thanks in advance,

Juan Dent, M.Sc.
date: Tue, 7 Oct 2008 19:30:00 -0700   author:   Juan Dent am

RE: Error 3033: Problem in mapping fragment   
Hello Juan Dent, 

I followed the document "How to: Define a Model with Single Entity Mapped 
to Two Tables"(http://msdn.microsoft.com/en-us/library/bb896233.aspx) as 
you mentioned. But, I did not reproduce the issue. The following is what I 
have done on my side,

1.Firstly, I created a LINQ to entity item from the AdventureWorks database 
with the tables Customer and Store in it. 

2.I copied the three XML code snippets "ConceptualModels", "StorageModels", 
"Mappings" from the above link into the AdventureWorks.edmx file, to 
replace the corresponding parts of the original document. 

3.Afterwards, I could compile and consume the single entity, which was 
mapped to two tables, in my project correctly. 

I saw that the XML code you posted was a modified version, but that looked 
pretty right to me, and I also pasted it into my AdventureWorks.edmx file 
for a test. It still worked fine. From the error description, I think this 
issue may result from the storagemodels' mismatch. So, to better 
troubleshooting this issue, would you mind sharing some more information? 
The whole AdventureWorks.edmx will be preferred, and you can send it to my 
email at v-jzho@microsoft.com. If that is inconvenient for you, posting the 
three parts, "ConceptualModels", "StorageModels", "Mappings" of the 
AdventureWorks.edmx file will also be helpful. 

This information is supposed to be collected for narrowing down the 
problem. I appreciate your understanding, as well as your time and effort 
on collecting and sending it. 

Have a nice day!

Best regards,
Ji Zhou (v-jzho@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Wed, 08 Oct 2008 11:55:08 GMT   author:   (\Ji Zhou [MSFT]\)

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us