After using Visual Web Developer 2010 Express to create an empty web site and adding a default aspx page, I needed to configure a membership and user login as decribed by the
article "Walkthrough:
Creating a web site with Membership and User Login."
The process involves
clicking on the Website menu then selecting
ASP.Net Configuration to open the
ASP.net Web Site Adminitration Tool,
and then clicking the Security
tab to view that page. At this point, the tool is supposed to automatically create an App_data folder in the project, and then build the ASPNETDB.MDF data base file in that folder. No connection string is needed in the web.config file for this
to work.
The Problem
The
Web Site Administration Tool creates the App_Data folder, but it does not create an ASPNETDB data base in that folder. The data base is supposed to be build into that folder. This is the error message displayed by the security tab of the
Web Site Administration Tool:
"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."
My Devoplement System
Windows Vista, 32 bit with an Admin account and a standard user account.
Web Developer 2010 Express is installed.
SQL Server 2008 Express is installed.
IIS is not installed.
My development machine is connected to a LAN that has a machine running Windows Home Server and a machine running Windows 7 connected to it.
Troubleshooting I have already Performed Without any Success
I re-installed Web Developer 2010 Express, which also re-installed the .Net 4 framework, and it is located in it's proper folder in the C drive.
I re-installed SQL Server 2008 Express, and it is located in the C:\Program Files\Microsoft SQL Server folder. That folder has these subfolders:
\80, \90, \100, \110, \MSRS11.SQLEXPRESS,
\MSSQL10.SQLEXPRESS, \MSSQL10_50.SQLEXPRESS, \MSSQL11.MSSQLSERVER, and
\MSSQL11.SQLEXPRESS.
I ran the SQL Server 2008 System Configuration, and it said the installation has no problems.
I have turned off the firewall and ran the tool, but encountered the same problem.
I have tried to run the tool from inside the Admin account, but encountered the same problem.
I have used ASPNET_REGSQL.EXE to create the ASPNETDB data base, but that only creates it in the
C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS/MSQL/DATAfolder.
I have copied the data base from the /DATA folder to the /App_Data folder, but that did work.
From the Win 7 machine on the LAN, I can create a website on the Win Vista machine and run the tool to create the App_Data folder and create the data base in that folder, but when I move to the Win Vista machine and open Web Developer Express and then run
the tool on the same web site that was created by the Win 7 machine, the tool fails; this is the message displayed by the Security Tab of the tool:
"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:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."
9. From the Win Vista machine, I can build a web site on the Win 7 machine, but I but encountered the same original problem when I ran the tool.
Clues to this Problem
It seems that there is some system configuration problem with my Win Vista machine that is preventing the tool from creating the data base, because I can use my Win 7 machine to create a web site then run the tool to create the ASPNETDB data base. There
is no clue that this is a connection string problem because this is about creating the data base, not connecting to it. But it does seem there is some problem with the tool communicating with SQL Express to create the data base.
Request for Help
If anybody has the knowledge to solve this problem, your help would be appreciated.
No connection string is needed in the web.config file for this to work.
You probably took this line out of the context on some page. While this is true it is also false. Yeah, debug this :D Let me explain...
By default it uses a connection string in machine.config file named
LocalSqlServer. For various reasons that connection string might or might not be correct. So it is almost always better to set your own connection string in applications web.config file.
Before you make any actions, find out the correct connection string for your database. After you have confirmed and successfully accessed your database, proceed. If it fails again, then create a database by "hand" and use ASPNET_REGSQL.EXE (aspnet_regsql.exe
-S <server> -U <login id> -P <password> -d <database> -A all)
Thank you for taking the time to answer my request for help; however, my problem is not about connecting to a data base, it is about creating the data base. There is something about my system that prevents the
Web Site Administration Tool from building the data base.
Thank you for the link to using "Membership in ASP.NET 2.0." I'll check-out. I hope it helps.
there is a difference in connecting to server or connecting to a database. If you can't connect to server you can't create a database. If your connection string is not valid, nothing will work. Based on your reply I'll assume that your
connection string is valid and you can create a
new database with it. I'll assume you created the database by hand and have successfully connected to it.
Check permissions of your SQL server. Does the account under which your Application/Web Site Administration Tool runs have the permission to access the server and create a database?
Is your SQL server running on the same machine that you are developing (dev machine)?
Does the user under which your account and visual studio is running have access to write/modify app_data folder?
Can you please post the detailed error (error code and message) you get?
Regards
Please "Mark As Answer" if the post helped you.
mitja.gti | www.mitjagti.com
A month ago I ran into the problem described above. I included a lot of information regarding system configuration and my own troubleshooting. You were the only one who took the time to help me, but your help was based on no real thought into the problem,
only off the cuff comments and assumptions, and maybe, a trolling effort just to get extra points as a member of this forum. I would have been a little thankful, but for someone who has close to 12,000 points, 2,093 posts, and carrying the title of the
"Microsoft 2011 Community Contributor Award," I expect you to provide some real concrete help. I'm saying this because for the following weeks you had me studying a lot of irrelevant material and irrelevant trouble shooting.
My code is all correct, and it should have worked. I have determined, without a doubt, that this problem is actually a Microsoft bug. The source is either from installing a Microsoft component, a failure for a Microsoft component to clean garbage in the
OS, or a failure for a Microsoft component to maintain specific data in the OS. Many other programmers have this same problem, but it manifests itself with other symptoms. But the problem is the same: an ASPNETDB Data Base for your web application cannot be
made.
SOLUTION
Here is the solution; delete the contents of the following folder:
…<OS User Account Name>\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
Mr. Foxcroft
0 Points
10 Posts
Web Site Administration Tool Does Not Create ASPNETDB Data Base
Jul 26, 2012 10:33 PM|LINK
Introduction to the Problem
After using Visual Web Developer 2010 Express to create an empty web site and adding a default aspx page, I needed to configure a membership and user login as decribed by the article "Walkthrough: Creating a web site with Membership and User Login." The process involves clicking on the Website menu then selecting ASP.Net Configuration to open the ASP.net Web Site Adminitration Tool, and then clicking the Security tab to view that page. At this point, the tool is supposed to automatically create an App_data folder in the project, and then build the ASPNETDB.MDF data base file in that folder. No connection string is needed in the web.config file for this to work.
The Problem
The Web Site Administration Tool creates the App_Data folder, but it does not create an ASPNETDB data base in that folder. The data base is supposed to be build into that folder. This is the error message displayed by the security tab of the Web Site Administration Tool:
"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."
My Devoplement System
Troubleshooting I have already Performed Without any Success
"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: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."
9. From the Win Vista machine, I can build a web site on the Win 7 machine, but I but encountered the same original problem when I ran the tool.
Clues to this Problem
It seems that there is some system configuration problem with my Win Vista machine that is preventing the tool from creating the data base, because I can use my Win 7 machine to create a web site then run the tool to create the ASPNETDB data base. There is no clue that this is a connection string problem because this is about creating the data base, not connecting to it. But it does seem there is some problem with the tool communicating with SQL Express to create the data base.
Request for Help
If anybody has the knowledge to solve this problem, your help would be appreciated.
mitja.GTI
Star
11157 Points
2094 Posts
Re: Web Site Administration Tool Does Not Create ASPNETDB Data Base
Jul 27, 2012 06:11 PM|LINK
Hi Mr. Foxcroft
You probably took this line out of the context on some page. While this is true it is also false. Yeah, debug this :D Let me explain...
By default it uses a connection string in machine.config file named LocalSqlServer. For various reasons that connection string might or might not be correct. So it is almost always better to set your own connection string in applications web.config file.
Before you make any actions, find out the correct connection string for your database. After you have confirmed and successfully accessed your database, proceed. If it fails again, then create a database by "hand" and use ASPNET_REGSQL.EXE (aspnet_regsql.exe -S <server> -U <login id> -P <password> -d <database> -A all)
I'm almost 99% sure this will solve your problem.
I'd also suggest you to read this article: How To: Use Membership in ASP.NET 2.0
mitja.gti | www.mitjagti.com
Mr. Foxcroft
0 Points
10 Posts
Re: Web Site Administration Tool Does Not Create ASPNETDB Data Base
Jul 31, 2012 12:26 AM|LINK
Dear mitja.GTI:
Thank you for taking the time to answer my request for help; however, my problem is not about connecting to a data base, it is about creating the data base. There is something about my system that prevents the Web Site Administration Tool from building the data base.
Thank you for the link to using "Membership in ASP.NET 2.0." I'll check-out. I hope it helps.
Sincerely,
Mr. Foxcroft
mitja.GTI
Star
11157 Points
2094 Posts
Re: Web Site Administration Tool Does Not Create ASPNETDB Data Base
Jul 31, 2012 01:18 AM|LINK
Dear Mr Foxcroft
there is a difference in connecting to server or connecting to a database. If you can't connect to server you can't create a database. If your connection string is not valid, nothing will work. Based on your reply I'll assume that your connection string is valid and you can create a new database with it. I'll assume you created the database by hand and have successfully connected to it.
Check permissions of your SQL server. Does the account under which your Application/Web Site Administration Tool runs have the permission to access the server and create a database?
Is your SQL server running on the same machine that you are developing (dev machine)?
Does the user under which your account and visual studio is running have access to write/modify app_data folder?
Can you please post the detailed error (error code and message) you get?
Regards
mitja.gti | www.mitjagti.com
Mr. Foxcroft
0 Points
10 Posts
Re: Web Site Administration Tool Does Not Create ASPNETDB Data Base
Aug 29, 2012 11:45 PM|LINK
Dear mittja.GTI:
A month ago I ran into the problem described above. I included a lot of information regarding system configuration and my own troubleshooting. You were the only one who took the time to help me, but your help was based on no real thought into the problem, only off the cuff comments and assumptions, and maybe, a trolling effort just to get extra points as a member of this forum. I would have been a little thankful, but for someone who has close to 12,000 points, 2,093 posts, and carrying the title of the "Microsoft 2011 Community Contributor Award," I expect you to provide some real concrete help. I'm saying this because for the following weeks you had me studying a lot of irrelevant material and irrelevant trouble shooting.
My code is all correct, and it should have worked. I have determined, without a doubt, that this problem is actually a Microsoft bug. The source is either from installing a Microsoft component, a failure for a Microsoft component to clean garbage in the OS, or a failure for a Microsoft component to maintain specific data in the OS. Many other programmers have this same problem, but it manifests itself with other symptoms. But the problem is the same: an ASPNETDB Data Base for your web application cannot be made.
SOLUTION
Here is the solution; delete the contents of the following folder:
…<OS User Account Name>\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
Sincerely,
Mr. Foxcroft
pitwood
Member
2 Points
4 Posts
Re: Web Site Administration Tool Does Not Create ASPNETDB Data Base
Jan 17, 2013 02:59 PM|LINK
Hi
I have the same problem, but I am not able to delete the SQLExpress folder - says there are files open.
I don't have Studio Express so cannot view the SQLExpress instance to close/detach it
Any advice would be gratefully received
Pitters