Solved

Configuring sqlmembership provider

Posted on 2013-01-14
5
140 Views
Last Modified: 2013-04-23
I am building webform application  using VS2012EXPRESS. I want to implent the sqlmembership for this. I installed all the necessary objects on my db server.
when i try test the connect by going to Project ,ASP.NET Configuration,provider tab.
Click on test i receive this error:
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.
What is the cause? i have attached my webconfig
CONFIG.txt
0
Comment
Question by:Atouray
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Daniel Van Der Werken
ID: 38774308
I don't think your connection string in the web.config is correct. All you have is:
connectionStringName="db_connection"

You need something that defines the connection more definitively:

http://www.connectionstrings.com/sql-server-2005

http://www.connectionstrings.com/sql-server-2012

i.e.
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

etc. Review the link I provided to see how this is done.
0
 

Author Comment

by:Atouray
ID: 38774503
i definately have a correct connection string. here is it:
 <connectionStrings>
    <clear/>
    <add name="db_connection" providerName="System.Data.SqlClient" connectionString="Data Source=myipaddresshere;Integrated Security=true;Initial Catalog=aspnetdb;User ID=sysad;Password=abc@123"/>
  </connectionStrings>
0
 

Author Comment

by:Atouray
ID: 38774511
i have provided a connection name for my connectionstring.This is a valid one.
0
 
LVL 19

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
ID: 38783914
Yeah. You're correct. Your connection string is probably fine; although, I don't see a database defined in your connection string.

I've implemented a custom role provider, so I have some idea of how role and membership providers are done. Basically, the provider maps to some database schema that needs to be pre-set. You don't state whether or not you ran the aspnet_regsql.exe tool. Did you?

Assuming you did, then you should have a set of membership tables created for you when you run this exe. Those tables will be what you're going to access the database.

Does the aspnetdb exist?
0
 

Author Closing Comment

by:Atouray
ID: 39104090
thank you
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

10 Experts available now in Live!

Get 1:1 Help Now