Related with joining of two tables

Posted by Amritha444 under C# on 12/28/2010 | Points: 10 | Views : 2617 | Status : [Member] | Replies : 6
hi all

i want to join two tables one contains some items and other contains its sum retrieves from database Mysql using query .How is this possible


Thanks in advance




Responses

Posted by: T.saravanan on: 12/28/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Amritha444,

Where do you join the tables in frontend (using c#) (or) backend (Database) ? Can you rewrite your question briefly ?

Thanks,
T.Saravanan

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amritha444 on: 12/28/2010 [Member] Starter | Points: 25

Up
0
Down
Im writing query in class using c# not in backend.iam just asking is there any method to join two tables as i want data in a single row.

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 12/28/2010 [Member] Starter | Points: 25

Up
0
Down
Hi Amritha,

If you dont mind can brief you question... what exactly you want to do..

Sathish Kumar S

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: T.saravanan on: 12/28/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

If you using join condition in two datatable means
Refer this link for to join two datatable...http://www.codeproject.com/KB/cs/TwoDataTablesOuterJoin.aspx

if you add the two datatable records using Merge method..

DataTable dt1=new DataTable();
DataTable dt2=new DataTable();
dt1.Merge(dt2);
return dt1;
// Get all records in dt1..
[Note: In merge method both tables column name and its datatype are same then only we can use merge method]


Thanks,
T.Saravanan

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amritha444 on: 12/28/2010 [Member] Starter | Points: 25

Up
0
Down
Iam retreving one table by writing query like
select ..... from tablename where .....
which returns some allowance and its and deduction...there may be more than 4 or 5 rows for particular employee contains his allowance amount and deduction amount

another table contains its sum of allowance and deduction . i want both in single table.
when writing all codes on one query itself some mistakes happening.is there any methods

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amritha444 on: 12/28/2010 [Member] Starter | Points: 25

Up
0
Down
i will try with the suggested methods

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response