[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

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

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
lapucca
Asked:
lapucca
  • 4
  • 4
1 Solution
 
Todd GerbertIT ConsultantCommented:
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
 
lapuccaAuthor Commented:
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
 
lapuccaAuthor Commented:
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
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.

 
Todd GerbertIT ConsultantCommented:
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
 
lapuccaAuthor Commented:
>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
 
Todd GerbertIT ConsultantCommented:
This is an IIS 6 web server (or the built-in web server for debugging in Visual Studio)?
0
 
lapuccaAuthor Commented:
Hi TG,
This is Windows 7 home premium PC and the IIS 7 came with the OS.
0
 
Todd GerbertIT ConsultantCommented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now