• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

Configuring sqlmembership provider

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
Atouray
Asked:
Atouray
  • 3
  • 2
1 Solution
 
Daniel Van Der WerkenIndependent ConsultantCommented:
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
 
AtourayAuthor Commented:
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
 
AtourayAuthor Commented:
i have provided a connection name for my connectionstring.This is a valid one.
0
 
Daniel Van Der WerkenIndependent ConsultantCommented:
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
 
AtourayAuthor Commented:
thank you
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now