- 0
c# entity framework 4.1 two tables with the same property name
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
KB5012643 is causing issues with some apps in Windows 11, but there's a workaround
By Usama Jawad96,
- microsoft
- windows 11
- (and 12 more)
- 3 replies
- 8 views
-
- 5 replies
- 980 views
-
- 12 answers
- 10,050 views
-
- 2 answers
- 1,918 views
-
- 2 answers
- 1,796 views
-
Question
paxa
i'm having some problems with entity framework and a sql database. so my problem is this: in my database there are two tables that have the same property, they are identical in type and length but they are not related in any way. no foreign key whatsoever. as soon as i start to interact with the database entity framework spits out the famous error:
i'm using the code first approach and a sql server 2008 by the way.
this is one of the class representations of the tables:
this is the other class representation of the table:
[Table("bi")]
public class TbPBi
{
[Required(AllowEmptyStrings = false, ErrorMessage = "O campo nome nao pode ser nulo")]
[MaxLength(55, ErrorMessage = "O campo nome nao pode ter mais que 55 caracteres")]
[Column("nome", TypeName = "char", Order = 62)]
public string TbBinome { get; set; }
}
[/CODE]
any idea on how to work around this? one more thing. the database must not be changed in any way. i cannot modify it.
help would be appreciated. thanks in advance
Link to comment
Share on other sites
3 answers to this question
Recommended Posts