Dear friends,
Best of the day, i will apreciate any solution from you,
i am writting a program that loop through set of records in a database
this database contain duplicate records to loop through the records i am
fist use a sql statement to pass the records to a datatable
- Select Distinct * from tbl_PatientsTable
i then use the following statement to loop through the record, where i find thesame record ID coming back it should skip it and take the next record it that way i will not display duplicates,
- var PatientIDs = "";
- DT1 = ConnectAll.LastDrugPickup(TextBox1.Text.Trim(), TextBox2.Text.Trim());
-
- foreach (DataRow r in DT1.Rows)
- {
- if (PatientIDs == r["PatientID"].ToString().Trim()) { break; }
- do other things ......
- }
But my problem is break command make the loop to happend only once.
please how can i resolve this without using break and be able to fetch my records with no duplicates, since DISTINCT could not help.