Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
11
Reply
How to avoid duplicate data during inner join
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Pavithra L
8 years ago
569
1
Reply
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();
}
Post
Reset
Cancel
Answers (
11
)
Next Recommended Forum
MVC
difference between 3 tier and mvc