Question : How do you test a dataset for the existance of  a record?

I have a dataset that i need to test to see if a record exist.  I am doing this so that drop down fields will not be deleted if they are attached to any record in transactions.

For example I do not want a customer record deleted, if they have any transactions.

Both datasets are present on the form.  The customerDS , and the transactionsDS.

Thanks in advance

Answer : How do you test a dataset for the existance of  a record?

Helping out this morning.

This would be your best bet:

    Dim foundRows As DataRow() = transactionsDS.Tables("TransactionTableName").Select("customer_id = 5")
    If foundRows.Length > 0 Then
         console.WriteLine("Found Transactions!")
    End If

You can do it without looping.

Bob
Random Solutions  
 
programming4us programming4us