Using the Security section of ASP.NET Configuration in Visual Studio 2008

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I am using the Membership feature of ASP.NET 3.5 in Visual Studio 2008 with
SQL Server 2005 Developer Edition. I have created the database in SQL Server
2005 (which is located on my local machine) and run aspnet_regsql to create
the appropriate database objects. However, when I go to Project -> ASP.NET
Configuration in Visual Studio 2008 and go to the Security section, I
recieve the following error message:


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.


I am not sure why I am recieving this error. I think my connection string in
my Web.config is correct, but I am not sure how to find out for sure. I am
not extremely experienced in database administration, can someone please
help me figure out what I am doing wrong? Thanks.
 
Hi
Did you configure SQL Server to accept remote connections?
Can you show us the exact error message taken from ERROR.LOG?
 
I have this same issue. I am using VS 2008, SQL 2005 and SQL is set to allow
remote connections. I ran aspnet_regsql.exe to create the data store.

When I go back into the Web Site Administration Tool I still get the
following:

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.
 
I found the issue, but what I did to make this work is not right.

1. Look at the machine.config you will see the following connectoin string.
<add name="LocalSqlServer" connectionString="data
source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
Instance=true" providerName="System.Data.SqlClient"/>

This is what The Config Wizard uses to connect. I have SQL 2005 on my
machine so the connection fails.

2. I changed the connection string to:

<add name="LocalSqlServer" connectionString="Data Source=MYLOCALSERVER;
initial catalog=MYDB_TEST;Integrated Security=True"
providerName="System.Data.SqlClient"/>

And now.... the wizard works... but this is not right. Change the web.config
each time so that you can connect using this tool, ah, something is missing
here.
 
#2 should have read "Change the connection string in the machine.config each
time for this tool to connect is not right..."

If it was a web.config setting that would be a different story.
 
Back
Top