|
My thanks again to all have posted back
answers to my questions. I am spending an average of five hours a day
writing this newest script and am eager to complete it.
I have a new question however and this is probably going to be the most difficult I am going to ask.
Okay, let's imagine that you are building a
library program. The database currently includes 200 books. These books
are stored in a table called tblBooks. It includes columns such as
Title, Author, Publication Date, Description, Popularity, etc.
Now, you want to make it so patrons can join.
Once they join they can have the program select their weekly reading
for them. It does this by selecting a random given number of books from
the library. However, it has to be smart enough to not keep assigning
the same books over and over again.
So, you want it to find five random books that
haven't been read by a given reader within the last month, how do you
do it?
I am currently attempting to use the new Profile feature in ASP.NET 2.0 and as I see it I have two options:
(1)I can create in the profile database a new column for each book and this can be filled with the date.
(2)I can create a hashtable or an array or something of the sort that contains all of the data in one field.
Usually, I would probably just create a new row,
something like UserID, BookID, LastRead. The problem is I am trying to
operate w/in the profile feature, and perhaps I should just abandon
this, but I am not sure. With the profile if I make an additional row
for each book then (I think) I would have to add a definition for each
book to the XML Web.Config file, which could become very troublesome.
Any ideas? I'd like to do this the smart way before I go
off doing it the stupid way and end up having to rewrite the whole
thing in the end.
David.
|