Solved

I have aspnetdb.mdf database but not able to create a provider in WAT

Posted on 2011-03-18
8
513 Views
Last Modified: 2012-05-11
Hi, I'm developing using asp.net 3.5, C# on Windows 7 home premium PC.   I have sql 2005 express and using it for asp.net security because it automatically created the aspnet_users database for me.  Unfortuneately, prior to this I also had installed 2 other instances of sql, sql2008 and sql advanced 2008.  I have stop these 2 instances services.  

I am able to create users and roles using WAT.  I have also successfully log in using this.  I can see the aspnetdb.mdf database from VS2008's Server Explorer.
I start WAT, Provider and the screen:
Your application is currently configured to use the provider: AspNetSqlProvider

Select a single provider for all site management data
Select a different provider for each feature (advanced)

I then click the Test in the next screen.  
AspNetSqlProvider  Test  

I got the next message
Provider Management  
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.  
0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 35170521
You have a database file, but the database doesn't have the all the tables that WAT is expecting (yet).

Open a command prompt, and run the command:
c:\windows\microsoft.net\framework\v4.0.30319\aspnet_regsql -C "Data Source=.\SQLExpress;Integrated Security=True;User Instance=True" -d "C:\users\lapucca\documents\visual studio 2010\projects\your solution folder\your project folder\aspnetdb.mdf" -A all

Open in new window


If you're not using .Net 4.0, change the first part of that to c:\windows\microsoft.net\framework\v2.0.50727...

The .\SQLExpress parts means connect to the computer . (a single period is short-hand for "this computer") and use the SQL instance SQLExpress.  That should work for you, but if you used a different instance name you might need to change it.

And, of course, the C:\users\lapucca\documents\...\aspnetdb.mdf part is the actual path to your database file.

Now you should be able to use the WAT.
0
 

Author Comment

by:lapucca
ID: 35174075
When I check the sql property it shows my computerName\SQLEXPRESS, so I guess '.' would be correct to use.  However, the problem is with the .net.  I have 2 folders with it and wonder which one should I use.  Please have a look at the attached screen shot of my folders.  Thank you.
0
 

Author Comment

by:lapucca
ID: 35174110
Also, Since i have the aspnet_Users database and my login with userid and password seem to be working.  I was just wondering what do I need to provider for?  Thank you.  
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 35176228
Well, if your project is .Net 2.0, 3.0 or 3.5 you'd use c:\windows\microsoft.net\framework\v2.0.50727\aspnet_regsql.exe, or if your project is .Net 4.0 use c:\windows\microsoft.net\framework\v4.0.30319\aspnet_regsql.exe (since .Net 3.0 & 3.5 are really just extensions of 2.0, they still use the .Net 2.0 tools).


>> Since i have the aspnet_Users database and my login with userid and password seem to be working.
Perhaps I misunderstood, I was thinking this was not the case - so using the web admin tool you are able to create users, and can login as those users, it's just the "Test" that isn't working?  Can you post your web.config?
0
 

Author Comment

by:lapucca
ID: 35176542
>so using the web admin tool you are able to create users, roles, and can login as those users
Yes, that is all correct
Please see my web.config in the attachment.  thank you.

web.config
0
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 35195215
This is an IIS 6 web server (or the built-in web server for debugging in Visual Studio)?
0
 

Author Comment

by:lapucca
ID: 35195427
Hi TG,
This is Windows 7 home premium PC and the IIS 7 came with the OS.
0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 35195513
Sorry, you probably mentioned that already...I should've re-read the earlier posts.

Anyway, I'm inclined to say that if it works just disregard the Test. ;)

But, I'll try and re-create the problem and see if I can't figure it out when I get in the office in the morning.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question