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
  #21 (permalink)  
Old September 27th, 2007, 04:40 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Alex,

one more thing to be aware of...

(as per readme in site generator). all code created by the generator will be overwritten by subsequent 'saves' into the same folder. so be careful if you've editted certain aspects (thinking mainly of aspx files -re filtering in particular) but need to re-run the generator to pickup new entities etc..)

jimi

http://www.originaltalent.com
  #22 (permalink)  
Old September 27th, 2007, 04:44 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Quote:
quote:Originally posted by rocco50
 Jimi,

Again, I am very new to asp.net, and took a break in my learning it, but I recall there is a GridView attribute - AllowPaging="True". What advantage does the paging dynamic SQL code provide?

About generics - its my biggest setback. :) I am spending way too much time trying to understand TBH, how to do things right from the get-go, and how to generalize my development, instead of learning ASP.NET basics..

Alex

- TheBeerHouse Mods Repository
http://www.sashka.com/TheBeerHouse/thebeerhouse.html
alex, alas this propery only informs the gridview that it should 'present' a pager at the bottom of the gridview, you must provide the logic (whic tbh does) to calculate the number of pages via the pagesize and count attributes in the sqlclient methods.

jimi

http://www.originaltalent.com
  #23 (permalink)  
Old September 27th, 2007, 04:54 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Alex,

finally, before i slink off to bed - let me know if you both 'get' the genericPaged stuff to work AND understand how the paging works. it's important to appreciate that it isn't an 'out of the box' feature and actually requires a lot of thought and at times compromises to make it all work (i.e. any sortable column really does require an index created on the table. this isn't obvious with small datasets but will quickly become apparent as you scale up). the moral being really, only index (and provide sorting) on columns which actually are application 'essential'

jimi

http://www.originaltalent.com
  #24 (permalink)  
Old September 27th, 2007, 05:19 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Alex,

just about to sign off now, but here's my 'default' set of templates that my entire site has some heritage from:

http://www.originaltalent.com/downloads/Templates1.zip

hope this clarifies the paging stuff (if you look at the files in DAL\SQLClient)

catch you later

jimi

http://www.originaltalent.com
  #25 (permalink)  
Old November 14th, 2007, 06:32 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi:

any progress on this...

"take any table (or set of tables) and based on PK&FK's, generate the parent child collections (LIST <T>..."

thanks

  #26 (permalink)  
Old November 14th, 2007, 06:43 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Quote:
quote:Originally posted by forumuser
 hi:

any progress on this...

"take any table (or set of tables) and based on PK&FK's, generate the parent child collections (LIST <T>..."

thanks

yes, i've redone a version of the site generator data.dll plus templates that does this. it still needs a tiny bit of tweaking, but is 99% stable and effective. i've put a copy of the dll and the new templates up for you to try. they come with no warrenty as i use them for my own purposes but let me know how you get on.

http://www.originaltalent.com/downlo...atesAndDLL.zip

jimi

http://www.originaltalent.com
  #27 (permalink)  
Old November 14th, 2007, 07:21 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well that was quick. many thanks. i'll give those a try.
quick question: what is the significance of grouping tables under one provider? should i be using one provider for any group of related tables?
thanks

  #28 (permalink)  
Old November 14th, 2007, 07:35 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

forumuser - each provider acts as a functional 'holder' for related tables. so, for example, you'd group tbh_category, tbh_articles, tbh_comment under one provider (called for example 'Articles') and similarly, tbh_department, thb_order, tbh_orderitem, tbh_orderstatus, tbh_product and tbh_shippingmethod under a different provider (called for example 'Store'). this way you get very tight logical groupings of your source code which makes it easier to extract little bits of functionality from if required.

you may want to download that zip file again as i've included a small help file. but basically to summerise. what i said in the help file was the fact that for any table that has a foreignkey setup on it, you will NEED to setup an index for that field as well, as setting up a foreignkey doesn't actually create an index on the FK field, merely an association. if you have an FK setup and no matching index, you'll get errors in the generated code. to fix this, merely add the appropriate index. the help file gives a few examples.

good luck...

jimi

http://www.originaltalent.com
  #29 (permalink)  
Old November 14th, 2007, 07:59 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks jimi. further....supposing i have a table which is related to two tables which in themselves are unrelated. eg

emplyees related to departments

and

employees related to assessments

is there a rule for this or do i make a decision based on likely useage or do they all in fact come under the one provider in this case?
many thanks again for your help

  #30 (permalink)  
Old November 14th, 2007, 08:07 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

forumuser - i think it's a judgement call in that case. at the end of the day, no matter which provider you group them under, they'll still be 'found' by the application. it's more an organisational benefit, rather than a functional definiton as such.

jimi

http://www.originaltalent.com
 


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
THB old Template... it´s time for a new look kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 October 5th, 2007 05:42 PM



All times are GMT -4. The time now is 04:09 AM.


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