PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Prevent duplicate value
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Prevent duplicate value
![]() |
Prevent duplicate value |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi everyone!
How can i prevent users from entering a duplicated customername in a vb .Net form? the form is already connectod to an access database (*.mdb) although i set the field customername as primary key from microsoft access but this isn't the solution. i want to prompt user: This customer name is already Registered. Please enter another one any solutions are welcomed. Best regards |
|
|
|
#2 |
|
Guest
Posts: n/a
|
mf_sina,
It depends on the structure of the application. I believe that the right place for that is when you submit the data to the database. If the filed you want to verify is a primary key the update will fail and you can go ahead and give the user a chance to change the name. You can probably use the Validating event and run a query against the user name when the focus lieve the field, but keep in mind that in general there are chances of multi-user access to the database, so if you verify at the moment user enters the username field there are chances that at the moment you submit data this name is already taken. So, my suggestion is to try to update the database and the operation fails then give the user chance to fix the problem. -- Stoitcho Goutsev (100) [C# MVP] "mf_sina" <mf_sina@yahoo.com> wrote in message news:eEePiKzZFHA.3648@TK2MSFTNGP14.phx.gbl... > Hi everyone! > > How can i prevent users from entering a duplicated customername in a vb > .Net form? > the form is already connectod to an access database (*.mdb) > although i set the field customername as primary key from microsoft access > but this isn't the solution. > i want to prompt user: This customer name is already Registered. Please > enter another one > > any solutions are welcomed. > Best regards > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

