comparing two datsets at runtime

Posted by Bhanubysani under Regular Expressions on 4/26/2011 | Points: 10 | Views : 944 | Status : [Member] | Replies : 3
hi i have a problem..there is any chance for comparing two datasets at runtime..

Regards,
Bhanu Prakash Bysani



Responses

Posted by: Ndebata on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Dear,
On which basis you want to compare these two datasets.



Bhanubysani, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhanubysani on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down
one datset contains all subcategories with check boxes and one dataset conatins in previous he selected subcategories..my requirement is already selected subcategories will be checked and remaining will be unchecked..

Regards,
Bhanu Prakash Bysani

Bhanubysani, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tijut2k on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down


Using linq over datatable

This sample uses Except to create a sequence that contains the values from numbersAthat are not also in numbersB.

public void DataSetLinq52() {

var numbersA = testDS.Tables["NumbersA"].AsEnumerable();
var numbersB = testDS.Tables["NumbersB"].AsEnumerable();

var aOnlyNumbers = numbersA.Except(numbersB, DataRowComparer.Default);

Console.WriteLine("Numbers in first array but not second array:");
foreach (var n in aOnlyNumbers) {
Console.WriteLine(n["number"]);
}
}


Best Regard's
Tiju Thankachan

Bhanubysani, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response