Solved

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

Posted on 2011-03-18
8
508 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now