473,734 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Want to Use Custom Validator To Check for Duplicate Record

We have 3 fields on our web form that makeup what could be a duplicate entry.
We would like to look at these three fields that the user enters and check
in the database to see the information in all three fields matches
information in the database. Can you do this in a custom validator?
Nov 19 '05 #1
9 3948
Sure you could... Give it a whirl and let us knwo where you get the
problem/issue.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Mike Moore" <Mi*******@disc ussions.microso ft.com> wrote in message
news:60******** *************** ***********@mic rosoft.com...
We have 3 fields on our web form that makeup what could be a duplicate
entry.
We would like to look at these three fields that the user enters and check
in the database to see the information in all three fields matches
information in the database. Can you do this in a custom validator?

Nov 19 '05 #2
How? We would like to have the message also displayed in the summary
validation.

"Curt_C [MVP]" wrote:
Sure you could... Give it a whirl and let us knwo where you get the
problem/issue.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Mike Moore" <Mi*******@disc ussions.microso ft.com> wrote in message
news:60******** *************** ***********@mic rosoft.com...
We have 3 fields on our web form that makeup what could be a duplicate
entry.
We would like to look at these three fields that the user enters and check
in the database to see the information in all three fields matches
information in the database. Can you do this in a custom validator?


Nov 19 '05 #3
"=?Utf-8?B?TWlrZSBNb29 yZQ==?=" <Mi*******@disc ussions.microso ft.com> wrote
in news:9A******** *************** ***********@mic rosoft.com:
How? We would like to have the message also displayed in the summary
validation.


Search the database. If there are multiple records, set Args.Isvalid =
False.
You can do ANYTHING in a custom validator. It basically executes any code
you place in there when a validation is called. Technically it doesn't even
need to do validation... you could use it for logging or whatever.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #4
are you suggesting to have one custom validation or to validate on each of
the three fields?

We would like to have a red askerisks appear beside the three fields if a
duplicate record is found in the database. We would also like to have the
duplicate message displayed in the summary validation control.

"Lucas Tam" wrote:
"=?Utf-8?B?TWlrZSBNb29 yZQ==?=" <Mi*******@disc ussions.microso ft.com> wrote
in news:9A******** *************** ***********@mic rosoft.com:
How? We would like to have the message also displayed in the summary
validation.


Search the database. If there are multiple records, set Args.Isvalid =
False.
You can do ANYTHING in a custom validator. It basically executes any code
you place in there when a validation is called. Technically it doesn't even
need to do validation... you could use it for logging or whatever.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 19 '05 #5
"=?Utf-8?B?TWlrZSBNb29 yZQ==?=" <Mi*******@disc ussions.microso ft.com>
wrote in news:B3******** *************** ***********@mic rosoft.com:
are you suggesting to have one custom validation or to validate on
each of the three fields?

We would like to have a red askerisks appear beside the three fields
if a duplicate record is found in the database. We would also like to
have the duplicate message displayed in the summary validation
control.

Is each text field a separate validation? If so, I would use 3 validators.
Two reasons: 1. Errors will be displayed in the validation summary. 2. The
askteriks will be displayed automatically.
You could use 1 validator - in this case just put a label beside the other
fields and set the text to *. However, placing error text into the
Validation Summary maybe more difficult.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #6
Another thing to mention is that it works when we have the summary validation
property set to showmessagebox = false, but we need it to be set to true. It
might be the way we are doing the validation. we have custom validation
controls that are set to false until are code runs and then sets them to
true, but the message box doesn't get displayed.

any suggestions would be helpful?

"Mike Moore" wrote:
We have 3 fields on our web form that makeup what could be a duplicate entry.
We would like to look at these three fields that the user enters and check
in the database to see the information in all three fields matches
information in the database. Can you do this in a custom validator?

Nov 19 '05 #7
thanks for your suggestions.... .

"Lucas Tam" wrote:
"=?Utf-8?B?TWlrZSBNb29 yZQ==?=" <Mi*******@disc ussions.microso ft.com>
wrote in news:B3******** *************** ***********@mic rosoft.com:
are you suggesting to have one custom validation or to validate on
each of the three fields?

We would like to have a red askerisks appear beside the three fields
if a duplicate record is found in the database. We would also like to
have the duplicate message displayed in the summary validation
control.

Is each text field a separate validation? If so, I would use 3 validators.
Two reasons: 1. Errors will be displayed in the validation summary. 2. The
askteriks will be displayed automatically.
You could use 1 validator - in this case just put a label beside the other
fields and set the text to *. However, placing error text into the
Validation Summary maybe more difficult.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 19 '05 #8
We have it working now, but the only problem is that the message box doesn't
pop-up. Would there be any reason why this is happening?

"Lucas Tam" wrote:
"=?Utf-8?B?TWlrZSBNb29 yZQ==?=" <Mi*******@disc ussions.microso ft.com>
wrote in news:B3******** *************** ***********@mic rosoft.com:
are you suggesting to have one custom validation or to validate on
each of the three fields?

We would like to have a red askerisks appear beside the three fields
if a duplicate record is found in the database. We would also like to
have the duplicate message displayed in the summary validation
control.

Is each text field a separate validation? If so, I would use 3 validators.
Two reasons: 1. Errors will be displayed in the validation summary. 2. The
askteriks will be displayed automatically.
You could use 1 validator - in this case just put a label beside the other
fields and set the text to *. However, placing error text into the
Validation Summary maybe more difficult.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 19 '05 #9
"=?Utf-8?B?TWlrZSBNb29 yZQ==?=" <Mi*******@disc ussions.microso ft.com>
wrote in news:62******** *************** ***********@mic rosoft.com:
We have it working now, but the only problem is that the message box
doesn't pop-up. Would there be any reason why this is happening?


If you have the new IE service pack loaded, it blocks pop-ups.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
7420
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type (text/html) for this document is used to serve both SGML and XML based documents, and it is not possible to disambiguate it based on the DOCTYPE Declaration in your document. Parsing will continue in SGML mode."...
9
5166
by: Alex Shirley | last post by:
Hi there I’m simply trying to check for a blank or empty value in a textbox on my webform. In this instance I do not want to use a requiredfieldvalidator, I want to use a customvalidator (as I have other code within the customvalidator which works). This won’t work (within servervalidate): If txtBox.Text.ToString = "" Then raise exception…..
0
1089
by: gjtired | last post by:
Hi, I created a custom validator to check that a user entered date is a valid date. It does display an error message when I enter an invalid date. When I correct the date I can't save the record because there is still an error on the page. Can someone please tell me what I need to do. Thank
8
3943
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on this line: Set rs = db.OpenRecordset("SELECT ID FROM Contacts WHERE (" & sWhere & ");") Contacts being the main table. I am using access 2003 The error message states that there are; Too few parameters. Expected 1 I have no idea how to...
8
13100
by: g_man | last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of a command button that closes the form. I have code in the Form_Error event that does a good job of providing a more meaningful error message than the default. It works in every situation except when the user clicks the close button. I am using Me.Dirty=False to force a save but if there are duplicates I just get the standard Runtime 3022 error message. I am wondering...
3
3537
by: Rich Squid | last post by:
Hello Here's my basic problem: On my asp.net form page I have a DetailsView (default mode=edit) bound to a AccessDataSource control. Users can successfuly update a databound template field, but I wanted to add a custom validator to check that the account number they are entering exists in a table in the Access Database.
2
2091
by: tinariver | last post by:
I am using the onServerValidate of CutomValidator. I have got the Calender control and a text control. When user pick the date from calender conrol and value goes in the text box. Now I have to validate the value entered by the user to check if it is a valid Date and and if the date is in specific range. So I am trying to validate it on server side using onServerValidate, but for somereason the custom validator is not invoking my server...
2
2548
by: Ranma13 | last post by:
Hello, I have a duplicate record check written in VB for a check in/check out database. Here's the pseudocode, written for the BeforeUpdate property on the form: If DCount(search for records with the same TimeIn and TimeOut) > 0 Then MsgBox("Duplicate record found") Undo and set focus End Sub This code works fine if you try to add a new record that has duplicate times for TimeIn and TimeOut, but when I try to modify an...
1
3884
by: Steveaux | last post by:
Hi, I'm new to ASP.Net, so this may be something simple that I forgot. I have a form where a person can create a login. I'm doing the processing on this myself. The form has a plethora of validators, including two custom validators. They check whether the user name exists among the users already registered, and the same with the email address. Both the validators process, but they don't stop the form from processing, so I end up with...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.