Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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
 
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old September 16th, 2007, 12:42 PM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I repeat that i don't think this it's the best way!

perhaps I give it a try!

Suppose that you delete a forum.
All the posts have a cascade delete, the things can be complicated...

Let's see that i understand.

Everytime that you delete you receive the number of cells deleted,
But on your way you want to receive a select of an auxiliar table with all the members affected by this delete.
then run a routine from asp, that update each member of this select. That's it?
  #12 (permalink)  
Old September 16th, 2007, 01:22 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Copenhagen, , Denmark.
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi again, Maxxim.

No, what I described would be a solution where the work takes place within the SQL Server.

Suppose you have the trigger I mentioned in place.

Step 1: You delete a forum.
Step 2: Cascading will start deleting the first thread in the first subforum.
Step 3: This fires off the trigger, which checks to see what thread was deleted, and it then does it's magic by grabbing the Distinct UserIDs plus the number of posts in the thread per user. The same trigger then updates the usercount per affected member.
Step 4: The next thread is affected. See Step 3 for the actions taking place.

Rinse, wash, repeat :)

You do not need to do anything in ASP. You simply called the DELETE_FOPRUM Sp (Again, I have not yet reached that part of the book, so things might be organised a little different. I just imagine there would be a DELETE_FORUM SP). The DELETE_FORUM in turn most likely would fire a DELETE_THREAD (or that's handled by ASP) per thread.

As soon as the trigger notices DELETEs took place, the trigger will fire as many times as needed (basically the same number of times the DELETE takes place). All this happens in the database engine, meaning that unless you want to provide visual feedback such as a progress bar, you would not need any roundtrips to the database inbetween.

Once I reach the Forums section, I will see if I can provide the code for the trigger for you :)


http://entropia-online.blogspot.com/
  #13 (permalink)  
Old September 16th, 2007, 01:32 PM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Viagra!
Do you know that with tbh method, you can't access to the "NumPosts" of a member?

This value are saved into a binary field with more values!
The only way to acess/update them is under asp.net!



  #14 (permalink)  
Old September 17th, 2007, 07:38 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Copenhagen, , Denmark.
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

Maxxim,

I did not realize that. I just saw you mentioned it earlier as well, but I might have missed that post before.

If your website will heavily make use of forums, and/or prgramability that relies lots on the profiles in order to get things done (mine will), I would recommend actually avoiding relying so much on the "traditional" setup asp.net offers.

Personally, I feel that it would be preferable to have certain properties of the userproile easily accessible in a proper column, rather than in an obscure string as it obviously is (I only now checked out the way the profiles are stored, and while this works fine for a whole bunch of user-related information that I most likely will not be accessing frequently, there are certain properties I would want to have some more control over).

Therefore, I guess I will either be adding some columns to the profile table, or use an additional table, which in turn will make it far more easy to keep things working, but allowing more control over the data I need (frequently changing data like the postcount would for instance be something I will most likely use this construction for).

I found this while looking into ways to extend the userprofile, and to me it seems like a very neat way to still stick to the standard membership and profile options asp.net offers, while allowing easy extension:

http://www.asp.net/downloads/sandbox...vider-samples/

I apologize for missing your reply earlier, and perhaps coming across stubborn. I'm just a big believer of using objects what they were created for, and I still think that using a trigger would be the best technical solution for what you described ;) If the TBH solution doesn't foresee using a trigger to do this, I'd personally opt for expanding the framework to suit my needs :)

Cheers,

Peter

http://entropia-online.blogspot.com/
  #15 (permalink)  
Old September 17th, 2007, 10:42 AM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ViagraFalls, no problem!

I will read this page! If all profiles values are saved in a single column each... this is good!
My question is if it has the same simplicity like basic profile/membership settings has!

Alternatively I decided to keep all profile settings into the profile...
But I'll put "NumPosts" into an auxiliar table!

  #16 (permalink)  
Old September 17th, 2007, 12:37 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Copenhagen, , Denmark.
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

Maxxim,

If I read correctly (I quickly browsed over the article, rather than reading it in detail), it's what you call "an auxiliar" table.

However, that shouldn't neccessarily change that much. The example has sample code, and what I saw seemed easy enough. Alternatively, if you think it'll be a hassle with stored procedures etc, you can always create a view over the two tables to join them, and then have the stored procedure refer to the view instead of the seperate tables (there's specific rules for updatable views, though).

I'm a big fan of using database object what they were intended for, but I'm also not afraid to try and invent some bypass solution to accomplish what I need/want.

:)

Peter

http://entropia-online.blogspot.com/
  #17 (permalink)  
Old September 17th, 2007, 01:07 PM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think i'll pass

This can be easy but now i don't have time to see if this really is so easy.

If you try to implement this on the future, give here some testimonial, if you can!

Thanks,
one more time

 


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
Breaking the Forums? iPagan BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 7 August 2nd, 2007 02:02 PM
help on forums dennisssss BOOK: ASP.NET Website Programming Problem-Design-Solution 1 February 4th, 2007 03:15 AM
Forums Help jsantamaria BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 August 28th, 2006 10:57 PM
more forums? MiltonBC Forum and Wrox.com Feedback 5 November 12th, 2004 03:15 PM



All times are GMT -4. The time now is 07:34 AM.


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