ASP.NET Website Administration Tool: Unable to connect to SQL Server database

ASP.NET Website Administration Tool: Unable to connect to SQL Server database

If you have problems connecting to SQL Server database through the ASP.NET Website Administrator Tool, you may try to perform one of the following steps:

Step 1:
In some cases, you need to change the connection string:

<connectionStrings>
<add name=”ApplicationServices”
connectionString=”data source=##SERVERNAME##;Integrated Security=True;Initial Catalog=aspnetdb”
providerName=”System.Data.SqlClient” />
</connectionStrings>

Step 2:
In some cases, the ASP.NET service account (Machine_X\ASPNET or Network Service) requries access granting to the source database:

— Grant ASPNET access to the database
USE [##DBNAME##]
GO

— Grant login to Network service for ASPNET membership
EXEC sp_grantlogin N’##SERVICEACCOUNT##’
go

— Grant minimum permissions
USE [##DBNAME##]
GO
sp_addrolemember ‘aspnet_Membership_FullAccess’, N’##SERVICEACCOUNT##’
GO

IMPORTANT NOTE:
From the information that I have gathered throughout the Internet, I believed you cannot use the AttachDbFilename with a full blown SQL Server. Either add “\SQLEXPRESS” (instance name) to your server name or get rid of the AttachDbFileName and use Database=”##DATABASENAME##”.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: