?
Solved

Configuring sqlmembership provider

Posted on 2013-01-14
5
Medium Priority
?
147 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
[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
  • 3
  • 2
5 Comments
 
LVL 20

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 20

Accepted Solution

by:
Daniel Van Der Werken earned 2000 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

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!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

752 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