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 Search this Thread Display Modes
  #1 (permalink)  
Old December 3rd, 2009, 03:36 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default Login Question

Hi Imar,

I am trying to setup a security page but I want to update and reference a seperate database from the default ASPNETDB.MDF. How can I check the information in the default database against the information in a seperate database?

For example:

A user creates an account on my site.
The user's account information is then stored in the ASPNETDB.MDF database.
I would like to be able to send this information to a second database and have the information stored there as well.

Also,
When a user logs in the login control checks the ASPNETDB.MDF database for the user's credentials. How can I make it check the second database for these credentials?

Thank you,


Chuck
Reply With Quote
  #2 (permalink)  
Old December 4th, 2009, 09:17 AM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Depending on what you want to do, you have a few options:

1. Reconfigure the <membership /> and other elements to just use a different database. Use aspnet_regsql to prepare that database.

2. Use database synchronisation to sync data between databases.

3. Write your own membership provider and talk to whatever database / data source you see fit.

4. Hook into the relevant ASP.NET controls (such as Login) and talk to your own database instead.

As you can see, you have many different options. It all comes down to what it is that you need, and why.....

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 December 7th, 2009, 03:54 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I've decided that the best approach for me is creating my own membership provider. I've searched but have yet to find a useful explanation of how to accomplish this. Are there any resources that you are aware of that may help me?

Thanks,


Chuck
Reply With Quote
  #4 (permalink)  
Old December 7th, 2009, 03:59 PM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Lots....

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=404
http://weblogs.asp.net/scottgu/archi...13/442772.aspx
http://msdn.microsoft.com/en-us/library/aa479030.aspx
http://msdn.microsoft.com/en-us/library/aa478948.aspx
http://download.microsoft.com/downlo...0Providers.pdf
http://weblogs.asp.net/scottgu/archi...25/423703.aspx

Have fun....

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
The Following User Says Thank You to Imar For This Useful Post:
eiviery (December 7th, 2009)
  #5 (permalink)  
Old December 7th, 2009, 04:05 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hey thanks for the ridiculously fast response...again....

I'll be back with more questions soon I'm sure.

I really appreciate all the help you've provided since I started your book. The company I am interning for basically said here...make this work... and up until I found your book I had absolutely no asp.net experience and very little web development experience. I hope I can count on you for assistance in the future.


Thanks,

Chuck
Reply With Quote
  #6 (permalink)  
Old December 7th, 2009, 04:32 PM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're welcome....

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
  #7 (permalink)  
Old December 14th, 2009, 02:11 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hello again,

I am trying to make this custom membership provider thing work but I just can't figure it out.

I've looked at tons of how-to's and tutorials on writing custom membership providers but the explanations are too ambiguous for me.

Is there a "simple" way for me to point my login control to another database?

Thanks for any help,


Chuck
Reply With Quote
  #8 (permalink)  
Old December 14th, 2009, 02:18 PM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Chuck,

If that database is not SQL Server, the answer is probably "no". It all depends on what you need. For other database systems, providers are available as well. However, if you're targeting a non-supported database system or a non-supported schema, you need to do it yourself.

If you're simply trying to reconfigure the SQL Server database that is used, the answer is yes, but AFAIK, that wasn't what you were after, right?

If your database is on SQL Server, you *could* use the SqlServerMembership provider, and modify the stored procedures to target your own database schema, Not pretty, and guaranteed to get you in troubles later, but it might work.


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
  #9 (permalink)  
Old December 14th, 2009, 02:38 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi Imar,

The database I want to use IS on SQL Server.
I just want to have the controls point to my sql database rather than the aspnetdb.

Are there specific procedures I would need to modify or am I just looking for references to the aspnet database that need to be changed?


Chuck
Reply With Quote
  #10 (permalink)  
Old December 14th, 2009, 03:08 PM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

But does your target database support the standard ASP.NET schema, or can you alter the database to support it?

This is what I meant when I said:

Quote:
1. Reconfigure the <membership /> and other elements to just use a different database. Use aspnet_regsql to prepare that database
Using a different database and / or a different server is a 2 minute job and requires just some config settings in your app, besides running aspnet_regsql to add the necessary database objects.

Can you elaborate on what exactly you require?

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
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Question in login script zone8567 Classic ASP Basics 1 May 25th, 2008 06:57 PM
one question about login control potato ASP.NET 2.0 Basics 1 July 12th, 2007 06:22 PM
a question about login control potato ASP.NET 2.0 Professional 0 July 11th, 2007 07:23 AM
Login Question Ben Horne Forum and Wrox.com Feedback 10 May 5th, 2004 01:03 PM
Login form question Jams30 PHP Databases 1 December 4th, 2003 12:10 PM



All times are GMT -4. The time now is 11:32 PM.


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