webparts with local SQL Server

A change to the Microsoft environment is the change to use as much as possible SQL Server Express. This is in my project not so usable. I use here a full installation of SQL Server 2008.

To change the behavior you have to add the asp sql parts, e.g. procedures and so on. The next step is to provide your website with the correct connection string.

Provide your SQL database with the ASP.NET schemas

Open a command-line window on your system and run the aspnetregsql.exe utility that is installed with ASP.NET 2.0 in under your C:\WINDOWS\Microsoft.NET\Framework\ directory.

Note that this utility can be run in either a GUI based mode or with command-line switches (just add a -? flag to see all switch options).

Change the connection string

Change/expand web.config with the following entries:

<remove name=”LocalSqlServer”/>
<add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=myWebParts;Integrated Security=True" providerName="System.Data.SqlClient"/>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s