KeyLimeTie Blog

Get Web Parts to work without SQL 2005 Express

By Brian Pautsch – 4/6/2006 7:50:50 PM. Posted to Thoughts.

By default, Web Parts uses the SQL 2005 Express provider for data storage.
To use SQL Server 2000 or SQL Server 2005 (Non-Express), you need to do the following:

1. Use the aspnet_regsql.exe tool located in
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\ to prepare SQL Server.
Basically, it will add the 'aspnetdb' database to your SQL Instance.



2. In your Web.config, add the following:
<connectionStrings>
  <add name="ConnectionString" 
    connectionString="Data Source=your_server_name;
    Initial Catalog=aspnetdb;Integrated Security=True"
    providerName="System.Data.SqlClient" />
  </connectionStrings>
<system.web>
  .
  .
  <webParts>
    <personalization defaultProvider="SqlPersonalizationProvider">
      <providers>
        <add name="SqlPersonalizationProvider" 
          type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"
          connectionStringName="ConnectionString" applicationName="/" />
      </providers> 
      <authorization>
      <deny users="*" verbs="enterSharedScope" />
      <allow users="*" verbs="modifyState" />
      </authorization>
    </personalization>
  </webParts>
</system.web>
That's it...just create a new Web Application and start adding in Web Parts.

Comments

On 1/8/2010 ramesh said:
I am getting following error:

On 4/16/2006 Tim Tullow said:
Thanks...I couldn't figure this out.

Leave a Comment

Name:
Email:
URL:
Comment:
Security Code:
Type Security Code:

Photos on Flickr

More Photos »

Search Blog


Get Email Updates

Like what you read here at KeyLimeTie? Sign up for our email list!

Subscribe