TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pavithra L
NA
336
64.2k
How to avoid duplicate data during inner join
Dec 15 2015 4:41 AM
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();
}
Reply
Answers (
11
)
Jump one controller to another controller in MVC 4
how to create dynamic checkbox using jquery