Thread: Approaching THB
View Single Post
 
Old September 27th, 2007, 03:48 PM
jimibt jimibt is offline
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,

Please forgive my ignorance, but what is the usefulness of the paged dataset procedures? Does it have something to do with paging and the datagrid? I remember reading that asp.net 2.0 supports paging and if I remember reading from Marco's book, he shows up how to use it. Are these procedures introducing something new? Again, sorry, I am very new to asp.net, and I have a tendency to jump in topics without learning the basics sometimes.

I added the two stored procedures to my database, and tried executing the site built with the Site Generator - I am getting the following error:

Server Error in '/TestSiteGen' Application.
Procedure or function 'genericPaging' expects parameter '@orderBy', which was not supplied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Procedure or function 'genericPaging' expects parameter '@orderBy', which was not supplied.

Source Error:

Line 44: protected IDataReader ExecuteReader(DbCommand cmd, CommandBehavior behavior)
Line 45: {
Line 46: return cmd.ExecuteReader(behavior);
Line 47: }
Line 48:


I figured I'd ask first before starting to dig in the code... :)

I am also wondering if I went about the right way to incorporate the generated site files with a new site. I chose "New Web Site", the site project got created, then I added a new ASP.NET folder App_Code. Then I copied the App_Code folder generated by Flixon into the porject directory to replace the App_Code folder created by Visual Studio. I also added a reference to the project to the AjaxControlToolkit.dll (from the Temp folder in the Site Generator). Is this the way you go about it when you create a new site, or is there a simpler way?

Alex

- TheBeerHouse Mods Repository
http://www.sashka.com/TheBeerHouse/thebeerhouse.html
Alex,

Basically, allow the site generator to do 'all the work' then open the website from the folder that you pointed the site generator to. all you need to do (to test a website), is to copy the C:\Program Files\Flixon\Site Generator\Temp\bin to your app folde, as well as copying C:\Program Files\Flixon\Site Generator\Temp\Admin to your app folder. you don't need to create new projects from vs2005 etc..

ok, paging!"! where to start. the genericpaging sql that i supplied is a 'backend' solution which works in tandem with the objectdatasource. in the standard tbh, you can see various examples of this in action (for example \App_Code\DAL\SqlClient\SqlForumsProvider.cs public override List<PostDetails> GetThreads(string sortExpression, int pageIndex, int pageSize) uses the same kind of logic in-line to allow tbh_posts to be 'paged'). however, all examples use bespoke SQL to achieve the result, the genericpaging sql works with ANY table.

hopefully, i've explained this as briefly and as detailed as possible to get you reaping HUGE benefits from this approach. of course, once you delve into this area, you realise that almost anything can become 'generic', which then creates the risk of not focussing on the task at hand, instead 'glossing' over the intracacies
- so, as they say 'caveat emptor' (or something like that) :)


jimi

http://www.originaltalent.com