i have a table stock with column stock_id,stock_code stock_desceription etc
stock_id is the primary key while i have stock_code is indexes/key i want stock_code to be unique i every row,am able to do so and also am able to check whether stock_code exist before i insert,now my question is how can i be able to check for dublicate before i update,
below are my code that check before i insert
tStock = svcClient.GetLocationStocksByScanCode(MainConn, cbolocation.SelectedValue, TxtScancode.Text).FirstOrDefault
If Not IsNothing(tStock) Then
MessageBox.Show("Item already exist in the location!", "Softbit Tech")
Return
End If
now what can i do to check before i update 
Ramesh BarikRank #3,664 · 401 reputationPosted Apr 11, 2017, 11:05 PM EDT
Jitendra ShekhawatRank #1,909 · 772 reputationPosted Apr 10, 2017, 4:37 AM EDT
Ranjeet PatraRank #1,436 · 1.1K reputationPosted Apr 11, 2017, 11:21 PM EDT
Carlos kambuiRank #2,642 · 528 reputationPosted Apr 12, 2017, 12:53 AM EDT
Ramesh BarikRank #3,664 · 401 reputationPosted Apr 12, 2017, 1:09 AM EDT