views:

34

answers:

1

I have a Vb form that inserts data into multiple tables and maintains the foreign key using a sope_identity. I am using an insert procedure to deal with the insertion. My problem is that why i insert my values in VB and click the insert button the values in the database are duplicated.

i need to prevent this from happeing. Any ideas please.

+1  A: 

You can find your offending code by setting up unique indexes on the tables. This would at the very least help you discover where your code is inserting the duplicates at. Have you considered stored procedures instead of using the code to insert? Not that it will prevent the duplicates from being inserted if you call it twice, but it might help you reduce the possibility of errant data.

Nick DeVore
will do .thanks