CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Validate unique values in a database

Print topic Send  topic

Author Message
kescott


Posts: 49
Posted: 10/22/2008, 1:35 PM

:-D

I have had some success, but not the answer I need yet.

I'm trying to validate two values in a database before a value is allowed to submit to the database. I have an employee entry form. I need to make sure that an emplyee's last name and first name is not in the database.

For example:

-------------------------|
Employees-------------|
-------------------------|
F_Name---|L_Name---|
-------------------------|
Bob_____|Jones_____|
Mary____|Hearts____|
-------------------------|

This is what I have so far any ideas...
if(L_Name!=null&&!provider.CheckUnique("L_Name",this)&&F_Name!=null&&!provider.CheckUnique("F_Name",this))  
errors.Add("L_Name",String.Format(Resources.strings.CCS_UniqueValue,"L_Name"));  
errors.Add("F_Name",String.Format(Resources.strings.CCS_UniqueValue,"F_Name"));

When I deliberatly enter a name that I know that exist in the database like "Bob Jones", an error explains that "Bob Jones" exist in the database.

However, if I enter "Bob" and attempt to submit, then explains that "Bob" exists in the database

or

if I enter "Jones" and attempt to submit, then explains that "Jones" exists in the database

_________________
B.S. of Computer Science
Class of 2005
Norfolk State University
Norfolk, VA
http://www.nsu.edu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.