Using Sql Provider but trying to write to xml

Topics: Business Logic Layer
Mar 14, 2009 at 4:11 AM
I switched my data provider in the Web.Config to mssql on my blog.  The new main page loads stating that I have successfully configured the BE to use the sql provider.  I went to try to delete the default admin account and I got an error because the engine is trying to delete from the xml file (permissions are not set on App_Data).  Should this not be deleting the user from the sql table instead?
Mar 14, 2009 at 4:38 AM
The DbBlogProvider doesn't handle the users/roles.  But BlogEngine comes with a DbMembershipProvider and DbRoleProvider in addition to the DbBlogProvider.  In your web.config file, you probably already have the DbMembershipProvider and DbRoleProvider defined in the <membership> and <roleManager> elements.  You would just need to change the default providers to the Db ones ...

<membership defaultProvider="DbMembershipProvider" ...

<roleManager defaultProvider="DbRoleProvider" ...

Then the be_Users, be_Roles and be_UserRoles tables in the database will be used instead of the XML files.

However, even if you use all 3 Db providers, there are still some other files that are stored in the App_Data folder.  So you should still set write permissions for the App_Data for some of these other files.
Mar 14, 2009 at 1:47 PM

Thanks for clarifying how the tables are used.

I appreciate your help.