Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 July 16th, 2011, 09:17 AM
Registered User
 
Join Date: May 2011
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default Advice please for previous user data

Hi,

Please can someone advise the best route forward?

I have an existing 'football predictions' website that I wrote in php. On that I used several session variables including a user number that I used to enter into a db table that recorded the predictions against that user.
I plan to rewrite the site in C# ASP.NET but keeping the previous data of users and predictions etc from last season as I'll need to show that in certain pages.

Therefore should I add the existing users data into the 'Users' table in the db aspnetdb (as I would like to use the new technology rather than session variables) or keep the existing user table I have and place in a separate table in another db and have to use session variables?

Also, as I have the existing user number in my predictions tables, is it possible to look up by this number as opposed to 'using User.Identity.Name' which looks up by name?

Many thanks in advance,

Dave
 
Old July 17th, 2011, 04:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I guess it depends a bit on where your data is stored, and how much work you're willing to put into this.

I can see a few options (there are more though)

1. Import users into the Users table based on the old data. You can write some code that reads data from the old system, and programmatically creates new users.

2. You can reuse some of the controls (like Login), and handle their events to look into your own database. E.g. with Login, it fires OnLoggingIn which you can use to query your users table for a user name and password.

3. You can implement your own Membership and optionally Roles and Profile providers. A bit more work, but much cleaner in the long run as you can use all of the security functionality against your own database structure. For some more details:

http://imar.spaanjaars.com/380/migra...s-and-profiles
http://imar.spaanjaars.com/404/using...rver-providers
http://www.google.com/#sclient=psy&h...=1050&bih=1262

With all options you still need to find a way to store the user's number; either in a Session variable or by looking it up each time you need it. You could store the old ID in the user's Profile or in a related table you can query later.

Hope this gives you some ideas.

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!
The Following User Says Thank You to Imar For This Useful Post:
Ossieboy (July 18th, 2011)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending user to previous page Scott Myers ASP.NET 2.0 Basics 2 August 17th, 2007 01:04 AM
Need Expert Advice - Checking Previous Records Zippyfrog Access VBA 4 July 15th, 2006 09:17 AM
Show fields depending on data entered in previous Vaz ASP.NET 2.0 Basics 0 June 27th, 2006 09:16 AM
logout the previous session for the same user Beulah VS.NET 2002/2003 2 October 15th, 2004 05:04 AM
How do I get Data from the previous node? runeteacher XSLT 5 October 13th, 2004 03:55 AM





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