Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-18
8
Medium Priority
?
515 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
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!

 
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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

618 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