I am doing a barcode scan application, so every time user scan a barcode the application retrieve a row from database and fill to the DataTable. I set clearbeforefill=false because i want the user to see the result for every scan. I want to prevent duplicate scan of one barcode when user scan too fast. I found that if I set DataSet.EnforceConstraint to true, it will prompt a unique violation message. However i just want the application to bypass the scan silently.So I tried to catch the ConstraintException as below
try{
tableadapter.fill(datatable,barcode);
}
catch(ConstraintException ex){
}
If i do nothing in the catch block, the DataTable will allow duplicated row, so do i need to manually remove duplicated item or check everytime before i fill a DataTable? Thanks for help