Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

If you have an option of disallowing duplicate table entries in your database then use that - what database are you using? You could then use Try, Catch to catch any exception that may be thrown if you try to entre a dup record.

 

If not you could use a SELECT sql command with a WHERE clause of the ID number you want to check for, if the sql select returns a record then the ID is already there if not then it is ok to insert data.

 

Stuart

Visit: VBSourceSeek - The VB.NET sourcecode library

 

 

"A mere friend will agree with you, but a real friend will argue."
Posted

ok suppose you dont want two ppl to have the same code name then what you can do is this

 

dim adr() as DataRow = Dataset.Tables("TableName").Select("EmpCode = '" & CODE & "'")

if adr.length = 0 Then

' the code to allow him to enter the value in db

Else

' sorry buddy value exists

End if

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...