Click here to Skip to main content
15,995,251 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI all !!!

I have two tables in my dataset.
Table1 (Month,Date ,Vno,VAmt,VDate,AccHead)
Table2 (AMonth,ARelMonth,AVAmt,AVDate,AVAccHead )

I want to show data like this

Month || RelatedMonth || VoucherNumber || VoucherAmount || AccountHead
----------------------------------------------------------------------------
April || March || xxx-xxx || 23455 || Head
------ March || yyy-yyyy || 456546 || AHead
May || April || xxx-xxx || 23455 || Head
------ April || yyy-yyyy || 456546 || AHead


here first row is from Table1 and second row is from Table2. This will continue upto March for the next year.

I have no idea how to do this. I have the data in the dataset. All i need to know is how to group the data from the two tables to get this sort of output.
Posted

1 solution

you can use Union method to get to table to one!
you can use selecting event of linq datasource:
C#
protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            e.Result = dt1.Union(dt2).ToList();
        }

you have two table in one list!
now customize your code!
 
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