Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have two tables-
TABLE - projectpaymentschedule

COLUMN - ppsID,milestone,completiondate,billingdate,billingrupees,projectid

dataset ds1;

TABLE - projectpaymentreceipt-

COLUMN - pprID,receiptdate,receiptamount,projectid

dataset ds2;

C#
ds1.merge(ds2);



i want these columns in a grid view.

i take two data set and try to merge but output is comes in different rows.
like first data set data is comes in first row and second data set data is comes in second row.
if there is 2 rows in both tables i want data only in two rows.

Thanks in Advance.
Posted

There are Several factors and options affect how new data is merged into an existing DataSet.Keep in mind the same..

following link may help you:

http://msdn.microsoft.com/en-us/library/aszytsd8.aspx[^]


http://stackoverflow.com/questions/9107231/how-to-merge-two-datatable-containing-different-column-based-on-condition[^]

U can Also Try with Same dataset and Diferent tables.
same as below link:

http://csharp.net-informations.com/dataset/dataset-merge-sqlserver.htm[^]
 
Share this answer
 
v3
Hi,
You can make it using T-SQL using INNER JOIN or union according to your business logic
Check here[^]
or
Check here[^]
Best Regards
M.Mitwalli
 
Share this answer
 
C#
sbSql.Append("select a.milestone,a.completiondate,a.billingdate,a.billingrupees,a.projectid, b.receiptdate,b.receiptamount from projectpaymentschedule a join projectpaymentreceipt b on a.projectid = b.projectid where a.projectid = @projectid");
 
Share this answer
 
Comments
mayankshrivastava 18-Apr-12 1:23am    
Hi, Thanx from reply.
but its not working properly.
if there s 2 rows in first table and 1 row in second table so it give two rows with repeat values of second table.

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