ASP .NET 2.0 Web Parts and SQL 2000
If you want to use web parts in a web application, you need a SQL database in the background, as the settings a user applies to a page containing webparts must be stored in a database for retreiving every time that user logs in the application. The default setting of the database connection is managed by the WebPartManager control and it implies the usage of SQL 2005 (Express). This control creates the connection to the database and a mdf file that stores the data inside the App_Data directory. This file supports the storage in the application directory, advantages being obvious.
But what do we do if we only have SQL 2000 available? SQL 2000 does not support user instances, thus mdf files. So, if there is no SQL 2005 installed on the machine the application runs and there is no alteration of the default settings, we will encounter an error.
What is the solution? There are 2 steps necesarry to configure SQL 2000 usage instead of 2005:
1. Configure SQL 2000 to contain the databases and stored procedures used by the WebPartManager. For this action, use the aspnet_regiis executable located in WINDOWS\Microsoft.NET\Framework\v2.0.50727 . This tool is a wizard that allows you to select a database where the tables and procedures will be created.
2. Modify the application web.config file to point to the previously configured database. The WebPartManager implicitly uses a connection named LocalSqlServer. You can overwrite it this way:
When you next run the application, you won't encounter any error related to the SQL Express access.
So, same as with all providers in ASP.NET 2.0, these configuration actions create a flexible architecture for which the back end data storage can be changed without any modifications to the pages or Web parts in the application.










Recent Comments
Starting form the sample I mentioned
Thanks for posting this. It sav
The left image does not overlap t
Was Looking for the "inline" and "at