Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old April 28th, 2009, 04:24 PM
Imar's Avatar
Wrox Author
Points: 66,836, Level: 100
Points: 66,836, Level: 100 Points: 66,836, Level: 100 Points: 66,836, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,161
Thanks: 65
Thanked 1,394 Times in 1,374 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!
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:37 PM



All times are GMT -4. The time now is 02:40 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.