Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody, i'm having a problem while programming on C#.NET:
I have two databases with the same structure(same tables and fields), and the problem comes when i create the DataModels for both. When i make a LINQ query like this:

var qry = from t in ctx.Table
where t.Field = 0
select t;

Visual Studio says:
"The member is defined more than once" Error: Ambiguity between 'Project.Table.Field' and 'Project.Table.Field'
It seems to be that VS can't recognize that they are differents DataBases.
Can you give me some help? I'll apreciate it.

Thanks in advance.
Best Regards.

-- EDIT --
SOLUTION:
Thanks to Brady Kelly for the reply.I´ve searched a little more and i´ve found that the solution is in a property of the Data Model, changing the value of "Custom Tool Namespace". Giving different namespaces works great!
Posted
Updated 25-Oct-10 1:43am
v2

1 solution

You need to pay attention to namespaces in scenarios like this. Your models have to be in separate namespaces, but I've found that when you generate a model from a DB, although the wizard asks you for a namespace, it still generates code with a namespace of the folder you add the model to. If both your models are under the project root, there is good chance they are in the same namespace.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900