Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 17, 2013 02:59 PM by pitwood
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
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
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.
Jul 27, 2012 06:11 PM|LINK
Hi Mr. Foxcroft
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)
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
Jul 31, 2012 12:26 AM|LINK
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.
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?
Aug 29, 2012 11:45 PM|LINK
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
Here is the solution; delete the contents of the following folder:
…<OS User Account Name>\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
Jan 17, 2013 02:59 PM|LINK
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