[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 480
  • Last Modified:

ASP.NET security configuration error: Unable to connect to SQL Server database.

I am getting the following error when trying to setup security config for my .NET site, but can't get past this error.  I have changed the connection string in my default website, given ASPNET user admin rights to the database, but still getting the error.  What else might be going wrong?

"There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Unable to connect to SQL Server database."
0
saturation
Asked:
saturation
  • 9
  • 7
1 Solution
 
aibusinesssolutionsCommented:
What does your connection string look like?  Are you using SQL Auth or Windows Auth?  Are you trying to connect to an existing database or are you using the ASPNET MDB file that connects to the SQL server as an instance?
0
 
saturationAuthor Commented:
     <connectionStrings>
            <add name="TestConnectionString" connectionString="Data Source=LAPTOP;Initial Catalog=Test;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
0
 
aibusinesssolutionsCommented:
Is the database installed as an instance? LAPTOP\SQLEXPRESS, or LAPTOP\SQL2005 ?

Are you running ASP.NET 2.0+?  You'll need to give access to Network Service in the database.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
saturationAuthor Commented:
I'm not quite sure (not a pro at this), but the database was created through Enterprise Manager from SQL Server 2000.
0
 
aibusinesssolutionsCommented:
When you connect to the database with enterprise manager, it should have the instance name there at the login screen..  It will either say LAPTOP or LAPTOP\SQL2000 or something like that.

If it's just LAPTOP, then that's what you'll connect to, but you may need to give Network Service access still.
0
 
saturationAuthor Commented:
It says "LAPTOP (Windows NT)" in Enterprise Manager....So...How do I give network service access?
0
 
aibusinesssolutionsCommented:
In the enterprise manager, connect to the database, then go down to the Security section, under Users, add a new User.

You can probably hit the advanced button and search for the username, it may be something like LAPTOP\Network Service
0
 
aibusinesssolutionsCommented:
Oh I forgot to mention, after you add the user, you'll want to set them as a dbowner on your database, or you could make them a global sysadmin if it's just for testing stuff on your laptop.
0
 
aibusinesssolutionsCommented:
Here is the correct username NT AUTHORITY\Network Service
0
 
saturationAuthor Commented:
The only thing I see with "Network" in it is "Network Configuration Operators".  Is this it?
0
 
aibusinesssolutionsCommented:
No, it should be NT AUTHORITY\Network Service

What OS are you running?
0
 
saturationAuthor Commented:
Win XP Pro...
0
 
saturationAuthor Commented:
Running it on my local machine...
0
 
aibusinesssolutionsCommented:
Yeah on XP Pro you definitely should have that user, try typing it in manually to add the user.

NT AUTHORITY\Network Service
0
 
saturationAuthor Commented:
No such luck...I am running all of this locally.   Does that make a difference?
0
 
aibusinesssolutionsCommented:
No, it shouldn't make a difference, you could just turn on SQL authentication and login with a SQL login on your connection string.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now