This section lists the configuration settings for the Data Access Application Block and the Validation Application Block used in the QuickStarts.
Data Access Application Block Configuration
The default connection string is configured as follows:
- Name: LocalSqlServer
- ProviderName: System.Data.SqlClient
|
Property
|
Value
|
|
Data Source
|
.\SQLEXPRESS
|
|
Integrated Security
|
SSPI
|
|
AttachDBFilename
|
|DataDirectory|aspnetdb.mdf
|
|
User Instance
|
True
|
Validation Application Block Configuration
The Address class is configured as follows:
Name: Address
- City
- String Length Validator
|
Property
|
Value
|
|
LowerBound
|
1
|
|
LowerBoundType
|
Inclusive
|
|
Negated
|
False
|
|
UpperBound
|
30
|
|
UpperBoundType
|
Inclusive
|
- Contains Characters Validator
|
Property
|
Value
|
|
CharacterSet
|
1234567890!@#$%^&*()-=
|
|
ContainsCharacters
|
Any
|
|
Negated
|
True
|
|
MessageTemplate
|
City may not contain numbers or punctuation characters
|
- Not Null Validator
|
Property
|
Value
|
|
Negated
|
False
|
- Line 1
- String Length Validator 1+
|
Property
|
Value
|
|
LowerBound
|
1
|
|
LowerBoundType
|
Inclusive
|
|
Negated
|
False
|
|
UpperBound
|
0
|
|
UpperBoundType
|
Ignore
|
- Line 2
- Or Composite Validator
|
Validator
|
Property
|
Value
|
|
String Length Validator : 0-50
|
LowerBound
|
0
|
|
LowerBoundType
|
Inclusive
|
|
Negated
|
False
|
|
UpperBound
|
50
|
|
UpperBoundType
|
Inclusive
|
|
Null Validator
|
Negated
|
True
|
The Customer class is configured as follows:
- Address
- Object Validator
|
Property
|
Value
|
|
TargetRuleSet
|
RuleSetB
|
- DateOfBirth
- Date Range Validator
|
Property
|
Value
|
|
LowerBound
|
1/1/1969
|
|
LowerBoundType
|
Inclusive
|
|
Negated
|
False
|
|
UpperBoundType
|
Ignore
|
|
MessageTemplate
|
Must be born after 1969
|
- Email
- Regex Validator
|
Property
|
Value
|
|
Options
|
None
|
|
Pattern
|
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
|
|
MessageTemplate
|
Invalid e-mail address
|
- FirstName
- String Length Validator
|
Property
|
Value
|
|
LowerBound
|
0
|
|
LowerBoundType
|
Ignore
|
|
Negated
|
False
|
|
UpperBound
|
20
|
- LastName
- Or Composite Validator
|
Validator
|
Property
|
Value
|
|
Starts with X RegEx Validator
|
Options
|
None
|
|
Pattern
|
X.*
|
|
MessageTemplate
|
Last name must start with "X"
|
|
Ends with z RegEx Validator
|
Options
|
None
|
|
Pattern
|
z*.
|
|
MessageTemplate
|
Last name must end with "z"
|
- RewardPoints
- Divisible By 10
|
Property
|
Value
|
|
Collection
|
Key: Divisor, Value: 10
|
|
Tag
|
Warning
|
|
Type
|
ValidationQuickStart.CustomValidators.DivisibleByValidator, ValidationQuickStart.CustomValidators,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
To change or view these settings, use one of the Enterprise Library configuration tools to open the configuration file in the directory that contains the QuickStart project file. Each time you build the Windows Forms example, Visual Studio copies the configuration file to the output directory for the project (the same directory where the QuickStart executable is created), and renames it to ValidationQuickStart.exe.config.
This means that if you want to use the configuration tools to change any of the configuration settings, and you are planning to rebuild the solution, you must change the settings by opening the App.config file located in the QuickStart source directory. You can use the configuration tools to open the ValidationQuickStart.exe.config file and change the application configuration. However, these changes will be overwritten during the next successful build.