Validation rules from database.

Topics: Validation Application Block
Nov 21, 2007 at 5:37 AM
I am very new to the world of programming, I was just starting to use Validation Application Block. My brequirement is that i have my rules in the database (not in config), because my application admin needs an option to change the rules and chances are that the field name that i validate might alco change.
More clearly, if i have a customer the custome name legth should be less than 10 charecters, but admin can later change to 8 also name can later change to username.please help me as soon as possible my requirement is immediate.
Nov 22, 2007 at 11:40 AM

There is no support for storing just the rules in a database. You could use the SqlConfigurationSource and store the config for the whole block in a database. If you do this, you'll need to build the SqlConfigurationSource quick start yourself (it's supplied with the source code) and use overloads for the validation methods that receive a configuration source. Keep in mind that this approach will store all the rules as a single xml blob in the database.

Why isn't changing the configuration file a valid alternative?