Solved

Configuring sqlmembership provider

Posted on 2013-01-14
5
145 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 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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

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