Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to check for duplicates before posting a new recor
Message
From
23/05/2005 22:34:54
Dave Porter
Medical Systematics, Inc.
Merced, California, United States
 
 
To
19/05/2005 08:24:39
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01015688
Message ID:
01016944
Views:
11
>Dave:
>
>We are checking for duplicates in the business object for the table you're checking. To do this, you would need to create a rule to check for duplicates, and call it from the CheckRulesHook(DataSet ds, string tableName) method. Here is a sample:
>
>public override bool CheckRulesHook(DataSet ds, string tableName)
>{
> if (ds != null)
> {
> DataRow dr = ds.Tables[tableName].Rows[0]; this.CheckForDuplicateStatusCode(dr["sa_status"].ToString(),(int)dr["pk_spstatus"]);
> }
> return this.ErrorProviderBrokenRuleCount == 0;
>}
>
>If this example, you would need to create a method called CheckForDuplicateStatusCode. This is where you would put your code to check for duplicate records.
>
>Hope that helps.
>
>Lori S.

Hi Lori,
What does your CheckForDuplicateStatusCode method look like??
I made one up that always returns an error condition and yet the error condition is not being caught... see new thread on this subject.
Dave
Previous
Reply
Map
View

Click here to load this message in the networking platform