Wrox Programmer Forums
|
BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
This is the forum to discuss the Wrox book Professional ASP.NET 3.5: In C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470187579
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2009, 06:06 PM
Authorized User
 
Join Date: Aug 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Red face MembershipProvider

Hi! I host a site on a server where the databases is created through a control panel. How do I customize my MembershipProvider manualy so that I can access the ASPNETDB.mdf which I created through the panel and restored with a .bak file.

I have added the line: <membership defaultProvider="MyAspNetSqlMembershipProvider">

Bu it still looks for the AspNetSqlMembershipProvider which ASP.NET uses...what must I do...because I get the following error when I try to access my MyProfile.aspx:

An attempt to attach an auto-named database for file C:\HostingSpaces\leonenjo\forro.co.za\wwwroot\App_ Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: An attempt to attach an auto-named database for file C:\HostingSpaces\leonenjo\forro.co.za\wwwroot\App_ Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error:


Line 40: Public Overridable Property ContactName() As String
Line 41: Get
Line 42: Return CType(Me.GetPropertyValue("ContactName"),String)
Line 43: End Get
Line 44: Set


Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\root\7f053bb1\85d3df98\App_Code.5m3lv152.1.v b Line: 42

Please help me...

Last edited by danievermaak; August 19th, 2009 at 02:02 AM..
 
Old August 19th, 2009, 01:29 PM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

You shouldn't have to actually switch out the provider, simply modify the SqlConnection that is being used to point to your database.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"
 
Old August 20th, 2009, 01:47 AM
Authorized User
 
Join Date: Aug 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thank you

Thank you, I'ver figured it out in the meantime, but so much thanx for your help!





Similar Threads
Thread Thread Starter Forum Replies Last Post
failed to login with membershipprovider swifty_programmer ASP.NET 2.0 Professional 3 May 4th, 2007 02:53 AM
failed to login with membershipprovider swifty_programmer ASP.NET 2.0 Basics 1 May 3rd, 2007 11:40 AM
how to use MembershipProvider.EncryptPassword kherrerab ASP.NET 2.0 Professional 1 March 14th, 2007 12:18 PM
Error when loading custom MembershipProvider mega ASP.NET 2.0 Professional 18 November 8th, 2006 04:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.