Solved

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

Posted on 2011-03-18
8
512 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Update one rows based on previous row 5 30
C# XML Get Values 4 35
Need help with another query 10 39
How to fix 'event logs could not be searched' error asp.net? 3 18
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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