prevent duplicate entries to database

前端 未结 3 1816
予麋鹿
予麋鹿 2020-12-04 01:05

I want to prevent duplicate entries to my inventory form using vb.net and MySQL as the database, here is my code:

 Private Sub Button4_Click(ByVal sender As          


        
3条回答
  •  爱一瞬间的悲伤
    2020-12-04 01:31

    There should be the way you:

    1) write a Trigger before Insert, and check if there is any similar row exist.
    2) Put Unique Index on columns

提交回复
热议问题