StrataFrame Forum

ErrorPrivider V.S. BO Check rules

http://forum.strataframe.net/Topic8899.aspx

By Ben Hayat - 5/19/2007

Is it better to use ErrorProvider to check user entry or let the BO check rules to validate the data?



Secondly, can ErrorProvider work with BO as it's datasource?
By StrataFrame Team - 5/21/2007

An error provider can work with the BusinessBindingSource as it's data source... but I'm not sure if it can work with a business object directly as it's data source.  The IDataErrorInfo interface used by the error provider is set by the BrokenRules collection.  So, when you add a broken rule to your business object, the IDataErrorInfo properties will return the correct value.  So, if you want to handle user entry and use the error provider, you'll need to handle the field changed events on the business object and validate the data within the events, adding broken rules if they're not properly set.