>Hi all,
> I use vb.net and dataset ... i write a function add the row in dataset. But if the key is duplicate,then not add it .
>So I want to check the dataset data . How can i do, thank you ..... May you give me idea , can use sql to check it in dataset data?.....If all you need to check is the data in the existing DataSet/DataTable, there are a number of methodologies you could use. LINQ would work, but I don't have the LINQ syntax memorized. However, I *do* know the DataTable.Select() method off the top of my head, so I'll show you the .Select():
DataRow[] rows = MyDataSet.Tables["MyTable"].Select("MyKey = " + NewKey)
if (rows.Length > 0) ' NewKey already exists, so you've got a duplicate
The above isn't actually VB, so I probably have the syntax wrong in that first line, but you get the idea ...
~~Bonnie