> 1. Am I doing at the right place?
Yes, this is the place where you should check your rules before saving
> 2. If yes, how do I suppress the warning message?
My fault...the VB .NET code in the Dev Guide was not correct. Try initializing your connection as follows:
Dim Connection As IDbConnection = Nothing
The C# code uses an output parameter (which VB .NET doesn't have) that doesn't require you to init the variable in C#.
> 3. For the line "Me.AddErrorProviderBrokenRule("CustomerID", message)", what should I put as the
> first parameter to replace CustomerID since this is a combination of fields?
The first parameter is used to determine which user interface control is associated with the error. So you can set it to any column you want to flag with the associated error.
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com