Home > Net >  Linq Union merge multiple tables, table structure is different, how to deal with the default column
Linq Union merge multiple tables, table structure is different, how to deal with the default column

Time:03-25

Two table structure
A table: User1: ID, Name, Sorce1
Table B: User2: ID, Name, Sorce1, Sorce2
Need to use Linq, A query set of two tables, returns the B table structure, but the default columns of A table Sorce2, don't know how to handle

Statement:
Var temp=(from a User1 in
Select new User2 {
ID=Anderson D, Name=a.N ame, Sorce1=a.S orce1, Sorce2=0}
The Union (
The from b in User2
Select new User2 {
ID=b.I D, Name=b.N ame, Sorce1=b.S orce1, Sorce2=b.S orce2}
)
This is an error: Set operations over the company store types are currently unsupported
Sorce2 is of type int
  •  Tags:  
  • LINQ
  • Related