Oct 20, 2011 at 5:47 AM
Edited Oct 20, 2011 at 6:33 AM
The validation message you are seeing is actually a warning so it does not interfere with editing and saving the configuration file. You can safely ignore that warning message.
It if is a nuisance then you could set a value for the Default Database and save the configuration. This will save a dataConfiguration section in your config file.
<?xml version="1.0" encoding="utf-8" ?>
type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
<dataConfiguration defaultDatabase="LocalSqlServer" />
It shouldn't do any harm but it does seem a bit excessive (and potentially confusing) to save actual configuration to simply eliminate a warning message from the configuration tool.
If you are really keen to remove the section it is possible. The reason the Database Settings is showing up is because there is probably an entry in machine.config for connectionStrings.
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
If you remove that entry from the machine.config then the Database Settings section should no longer appear.
For the curious: How does the configuration tool know what sections to display? First it gets a list of all loaded assemblies. Then it checks this list against any Enterprise Library configuration section registered handlers. Next the tool
does another check to see if that section exists and if it does it displays that section in the configuration tool. The Data Access Application Block handles the dataConfiguration and connectionStrings sections so when the connectionStrings section appears
in machine.config it causes the tool to display the Database Settings.