 |
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
|
|
|
|
|

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

December 4th, 2009, 09:17 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

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

December 7th, 2009, 03:59 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

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

December 7th, 2009, 04:32 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You're welcome....
Imar
|
|

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

December 14th, 2009, 02:18 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

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

December 14th, 2009, 03:08 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
 |