Results 1 to 2 of 2

Thread: Double Record In DB

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    ENGLAND
    Posts
    38

    Double Record In DB

    Dear All
    I have a code to insert OperatorName and Password to the database.
    But I have a concern that if operator records his/her name twice to the DB then it will be double records which I do not want this to happen in my code.
    How can I write a vb.net Code to check UserName in the Database before save it.
    Many Thanks for any help
    salih
    sa

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    In your database define the filed to be unique and in your code catch the System.Data.ConstraintException
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width