ok thanks..
i figured out a solution
for(int i = 0; i < dataSet.table.Rows.Count ; i++)
{
Dataset.Row row = dataSet.table.Rows[i] as Dataset.Row;
if(row.RowState.ToString() != "Deleted")
{
idToCheck = row.ID;
linkToCheck = row.Link;
}
for(int j=i+1; j < dataSet.table.Rows.Count; j++)
{
Dataset.Row row1 = dataSet.table.Rows[j] as Dataset.Row;
if(row1.RowState.ToString() != "Deleted")
{
if(row1.ID == idToCheck)
{
duplicateID.Add(row1);
}
}
}
}
"Ciaran O''Donnell" <(E-Mail Removed)> wrote in
message news:E7140369-FC58-4FB4-A704-(E-Mail Removed)...
> is this data from a database, if so then you should be performing the
> checking there as the dbms will have an efficient way of doing it.
> Other wise I dont know of a way to do it bar using the select method on
> the
> datatable for each row. that stops the nested loops in your code but
> really
> just moves one into the datatable object. will possibly be faster though.
>
> --
> Ciaran O''''Donnell
> http://wannabedeveloper.spaces.live.com
>
>
> "Arvi" wrote:
>
>> Hi,
>>
>> Is there any way to check for the duplicated (fluteid) records in the
>> dataset other than the following method?
>>
>> i need to avoid goin thru all the records everytime (squaremethod)
>> instead
>> i want to check with the triangle method. can someone help me here?
>>
>>
>>
>> foreach (Dataset.FluteRow row in dataSet.Flute.Rows)
>>
>> {
>>
>> idToCheck = row.FluteID;
>>
>> linkToCheck = row.FluteLink;
>>
>>
>>
>> foreach (Dataset.FluteRow row1 in dataSet.Flute.Rows)
>>
>> {
>>
>> if(row1.FluteID == idToCheck && row1.FluteLink != linkToCheck)
>>
>> {
>>
>> duplicateID.Add(row1.FluteID);
>>
>> }
>>
>> }
>>
>>
>> }
>>
>>
>>