Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
check if value already exist
Carlos kambui
Apr 10 2017 8:21 AM
296
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
show the database graph chart
How to Get the Last Record from SQL Table