Hai ,
In my project am using C# windows application. Here am I using Inner join for connect two datatable . I want to avoid the duplicate data during INNER JOIN from one table.
For an Example:
| Job No | Order Qty | Job No | Knitt Qty | Machine |
| 1 | 1000 | 1 | 500 | 26 |
| 1 | 1000 | 1 | 500 | 26 |
am using below code for this table:
Here I want to avoid the 2nd row entry of Job No and Order Qty only . How can I do this. Please anybody help this.
da = new SqlDataAdapter("select j.Group_Name,j.Due_Amt,p.Receipt_No,p.Customer_Name,p.Paid_Amount from Chit j INNER JOIN Chit_Collection p on j.Group_Name=p.Group_Name GROUP BY j.Group_Name", con1);
dt = new DataTable();
da.Fill(dt);
foreach (DataRow item in dt.Rows)
{
int n = dataGridView1.Rows.Add();
dataGridView1.Rows[n].Cells[0].Value = item["Group_Name"].ToString();
dataGridView1.Rows[n].Cells[1].Value = item["Due_Amt"].ToString();
dataGridView1.Rows[n].Cells[2].Value = item["Receipt_No"].ToString();
dataGridView1.Rows[n].Cells[3].Value = item["Customer_Name"].ToString();
dataGridView1.Rows[n].Cells[4].Value = item["Paid_Amount"].ToString();
}

Gomathi RaguprasadPosted Dec 16, 2015, 6:20 AM
Hi,
I think, Its not possible to make group name and Due values to null or delete with your requirement.Because the customer and group name mapping will get affect.
select distinct j.GroupName,j.Due from Chit j INNER JOIN Chit_Collection p on j.GroupName=p.GroupName
SELECT ReceiptNo,Customer,Paid FROM Chit j INNER JOIN Chit_Collection p on j.GroupName=p.GroupName
Ranjit PowarPosted Dec 16, 2015, 2:32 AM
Pavithra LPosted Dec 15, 2015, 8:13 AM
Raja TPosted Dec 15, 2015, 8:01 AM
Pavithra LPosted Dec 15, 2015, 7:24 AM
Raja TPosted Dec 15, 2015, 7:12 AM
Pavithra LPosted Dec 15, 2015, 5:56 AM
Pavithra LPosted Dec 15, 2015, 5:36 AM
Manas MohapatraPosted Dec 15, 2015, 5:26 AM
Pavithra LPosted Dec 15, 2015, 5:06 AM
Manas MohapatraPosted Dec 15, 2015, 5:02 AM