How to User SQLserver DB provider.

Topics: ASP.NET 2.0
Oct 1, 2012 at 7:50 AM

Hi!

I have created new database for Blogs.

I have done following changes in web.config as per guide lines.

 

<blogProvider defaultProvider="DbBlogProvider">
            <providers>
                <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core" />
                <add name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" connectionStringName="BlogEngine" />
            </providers>
        </blogProvider>

Then I have set proper Connection string for connectionStringName="BlogEngine"

I have also changed following.

 

<membership defaultProvider="DbMembershipProvider">
            <providers>
                <clear />
                <add name="XmlMembershipProvider" type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core" description="XML membership provider" passwordFormat="Hashed" />
                <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
                <add name="DbMembershipProvider" type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core" passwordFormat="Hashed" connectionStringName="BlogEngine" />
            </providers>
        </membership>
        <roleManager defaultProvider="DbRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".BLOGENGINEROLES">
            <providers>
                <clear />
                <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider" />
                <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
                <add name="DbRoleProvider" type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" connectionStringName="BlogEngine" />
            </providers>
        </roleManager>

 

But when I am open default page it throws exception.

Cannot insert the value NULL into column 'BlogId', table 'montotec_BlogsMonto.dbo.be_DataStoreSettings'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Please help me out to fix this.

any help will be appreciates!

Regards.