Last post Aug 19, 2014 03:10 PM by email@example.com
Aug 19, 2014 03:10 PMfirstname.lastname@example.org|LINK
I just installed enterprise library data application blocks using nugget. Below is the command :
PM> Install-Package EnterpriseLibrary.Data -Version 5.0.505
I also configured the web.config file using configuration editor, but when I go to my class, I am writing the code
Database db = DatabaseFactory.CreateDatabase("ConStringAutoMilesSqlDB"))
Database is not recognized, it says database is a type and cannot be used as an expression. I added the following at the top of the c lass
when I was using the configuration editor then I right clicked on the web.config file and choose "Edit enterprise library v5 Confuguration" and under the application settings, I just choose the location of the web.config file and under database settings,
I just choose the default database name and required parameter is set to true. I think these are added in my web.config file
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
and in app settings
Those are the only changes that I can see in the web.config file.
any help will be appreciated.