Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 April 28th, 2009, 07:33 AM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default ASPNETDB.mdf again

Ok no real problems here I just want to clarify a few things about this database that asp.net defaults too.

What if you have a database already with user information etc, with the creation of the ASPNETDB you would then have 2 and split stored information. Isn't this inefficient and costly dependant on how your service provider charges for databases?

So you would have to copy the relevant information from the old database into the ASPNETDB? Or are you able to specify just to use the old database exclusivly and not have the ASPNETDB.mdf?

This is all hypothetical and something that just popped into my head
 
Old April 28th, 2009, 04:24 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Will,

The database is indeed created automatically, unless you tell it otherwise. It's possible (and pretty common) to prepare your own database to work with Membership, Roles and so on. The steps you need to perform are roughly like this:

1. Make sure you have a database for your site

2. Run the tool aspnet_regsql against your database to prepare it for the ASP.NET Services.

3. Tell your application to use this database, instead of the autogenerated one. A quick way to do this (although it feels like cheating) is to override the LocalSqlServer connection string. A bit slower but more correct is to reconfigure the services in your web.config and tell them to use your own connection string.

For a great explanation (and the cheating solution of the LocalSqlServer string) check here:

http://weblogs.asp.net/scottgu/archi...25/423703.aspx

Once you got that working, take a look here: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=481, especially the section "Enable ASP.NET Membership and the RoleManager" where you can see the full code for two services. Once you have that code in your web.config, you can change the reference to LocalSqlServer to your own connection string you use throughout the application.

Probably more information than you wanted, but I hope it helps ;-)

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 28th, 2009, 04:30 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Thanks alot. I will read through those links when I get a chance tomorrow.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASPNETDB.mdf Will BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 April 27th, 2009 01:07 PM
Question about ASPNETDB.MDF frankym BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 October 3rd, 2008 11:26 AM
Get password value from aspnetdb.mdf rsearing ASP.NET 2.0 Basics 8 October 12th, 2007 09:12 AM
ASPNETDB.MDF Changing motemape BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 May 27th, 2007 06:14 AM
aspnetdb.mdf Jackxxx ASP.NET 2.0 Basics 0 January 9th, 2007 01:37 PM





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