I’m trying to add data to a dataset, but I need to check that my new code won’t violate the unique indexes.
We’re using the Select method to do this:
if ((((DataRowView)ttTableBindingSource.Current).IsNew
|| ((DataRowView)ttTableBindingSource.Current).IsEdit)
&& bankingDataSet.ttTable.Select("name = '" + tbxName.Text + "'").Length > 0)
{
That’s working fine where the index is unique on name only. However there is another table where the unique index is on name and account.
I’m not sure how to build the syntax for the Select method to handle the 2 fields in one search.
Many thanks
Colin
1 Answer