Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

transfering ASPNETDB.MDF Authentiocation to SQLServer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GaryDean - 15 Aug 2007 17:14 GMT
I have a 2.0 Website application in the dev environment that uses a SQL
Server 2005 DB and also uses the authentication controls and classes that
automatically use SQLServer Express.  It all works fine in the dev
environment.

Now I want to deploy but I want to transfer what's in the ASPNETDB.MDF db
into my 2005 database so that I don't need to deploy SQLServer Express.  I
can import those tables into my man database but I can't seem to find what
is pointing to the express database.

I've googled around but everything I've found seem to just talk around the
issue.

Anyone know how to do this?  What needs to changes?

Thanks,
Gary
Ladislav Mrnka - 15 Aug 2007 17:54 GMT
Hi Gary,
ASP.NET 2.0 ships with predefined SqlMembership provider which point to
local SQL Express database - you can find its declaration in machine.config
(c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config):
   <membership>
     <providers>
       <add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
     </providers>
   </membership>

If you want to connect to another SQL server database you have to register
new provider instance in your web.config file:

   <membership defaultProvider="SqlProvider">
     <providers>
       <clear />
       <add connectionStringName="myConn" applicationName="/"
name="SqlProvider"  type="System.Web.Security.SqlMembershipProvider" />
     </providers>
   </membership>

You have to define connection string (named myConn in my example) to point
to your new database. If you are going to use full SQL 2005 you will also
need to create login for your application to allow connection to database.

Regards,
Ladislav

> I have a 2.0 Website application in the dev environment that uses a SQL
> Server 2005 DB and also uses the authentication controls and classes that
[quoted text clipped - 13 lines]
> Thanks,
> Gary
Steven Cheng[MSFT] - 16 Aug 2007 03:27 GMT
Thanks for Ladislav's informative inputs.

Hi Gary,

For your deployment scenario here, I think the following two things are
most important:

** Since SQL Server Express's database(your current mdf data file based
database ) are just a standard SQL server 2005 data file, you can simply
copy it to production server and use "attach database" operation:

#How to move SQL Server databases to a new location by using Detach and
Attach functions in SQL Server
http://support.microsoft.com/kb/224071

** You need to customize the default SQL membership provider's
connectionstring(by default point to local sqlexpress instance) or you can
add a new custom membership provider(also use the SqlMembershipProvider
class) and use your own connecticonstring to the standard SQL Server
instance:

#Examining ASP.NET 2.0's Membership, Roles, and Profile - Part 1
http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

#How to Configure Your ASP.NET 2.0 Account's Membership Database
http://help.maximumasp.com/smarterticket/Customer/KBArticle.aspx?articleid=8
78

Hope this helps. If you have any further questions, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
   

This posting is provided "AS IS" with no warranties, and confers no rights.
GaryDean - 19 Aug 2007 18:43 GMT
Steven,
I'm starting a new thread on this as my problems are getting worse on this
issue.  Hope you can have a look.

Signature

Regards,
Gary Blakely

> Thanks for Ladislav's informative inputs.
>
[quoted text clipped - 54 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Steven Cheng[MSFT] - 20 Aug 2007 02:30 GMT
Hi Gary,

Thanks for your reply.

Do you mean the following new thread you posted?

"SQL Membership Provider Problem"

No problem. I'll have a look and reply you there.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.