Confirm that user has already registered VB

0

I'm developing a Visual Basic application, where I insert the records into a database in sql server, these records are shown in the form to the user in a datagridview, and I want to confirm whether the record is already done or not , or if the fields that the user enters already are in the datagridview, especially the id field that is my primary key!

I await response! Best Regards

    
asked by anonymous 14.03.2016 / 13:57

1 answer

0

You can encapsulate your method within a catch catch statement link to see if any error.

If you have created the ID field as IDENTITY you can use the sql statement to retrieve the code:

SELECT IDENT_CURRENT('TABELA');
    
05.04.2016 / 20:00