So Table 1 Is Parent Table and Table 2 is Child Table I need to give Relation to both. I need to remove Extra Columns From
Table 2 I need to keep only same column as Table 1
I.e in Table 2 I need to Keep only this result
Name Dept EMpId Location
Ajay IT 6555 Hyd
Is it possible to Sort this out from Code Behind? Can some one help me please
aparitala
Member
13 Points
83 Posts
How to make two Tables as Same Columns
Nov 21, 2012 07:00 PM|LINK
Hi is it possible?
In Dataset I'm getting two Tables
in Table 1 I have these results Say
Name Dept
Ajay IT
In second Table
Name Dept EMpId Location
Ajay IT 6555 Hyd
Xyz IT-IS 544 Vj
So Table 1 Is Parent Table and Table 2 is Child Table I need to give Relation to both. I need to remove Extra Columns From Table 2 I need to keep only same column as Table 1
I.e in Table 2 I need to Keep only this result
Name Dept EMpId Location
Ajay IT 6555 Hyd
Is it possible to Sort this out from Code Behind? Can some one help me please
</div>msmk
Participant
776 Points
158 Posts
Re: How to make two Tables as Same Columns
Nov 21, 2012 07:16 PM|LINK
Is there a reason you don't want to do it in the query using a join?
aparitala
Member
13 Points
83 Posts
Re: How to make two Tables as Same Columns
Nov 21, 2012 07:42 PM|LINK
Because i want to use the existing Stored Procedure.
If it possible thats well and good.
alankarp
Contributor
2042 Points
345 Posts
Re: How to make two Tables as Same Columns
Nov 22, 2012 10:48 AM|LINK
Hi,
I think here you are talking about datatable. You can join two datatable from c# code. Please have a look at below URLS
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/f122d7f4-3b7d-4d93-bd0f-8bb57cd990a4/
http://msdn.microsoft.com/en-us/library/system.data.datatable.merge.aspx
Thanks
Alanakr
Profile
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: How to make two Tables as Same Columns
Nov 23, 2012 12:27 AM|LINK
It's not so easy to change a diagram, So I still suggest you using inner join:
http://forums.asp.net/t/1860340.aspx
thaicarrot
Contributor
5130 Points
1464 Posts
Re: How to make two Tables as Same Columns
Nov 25, 2012 09:04 AM|LINK
Too simple. If you would like to use Stored Procedure, Do you know about Complex Type?
Try using DTO class. Are you using Dependent Navigation or In-Dependent Navigation?
It should be Dependent Navigation. Do you have it at data base layer? Event if you can do that at EF layer but not sugguest
Hope my word help you out.
Weera