Wrox Programmer Forums
|
BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Server Control and Component Development by Dr. Shahram Khosravi; ISBN: 9780471793502
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 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 April 3rd, 2007, 08:49 AM
Authorized User
 
Join Date: Sep 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chp.12 'custom' SqlDataSource and paging

Mr. Khosravi-

The 'StartRecordParameterName' and 'MaxRecordParameterName' properties..I'm confused as to how these are used to determine if the sqldatasource object allows for paging.

MSDN indicates the following:

Quote:
quote:"If the data source does not support paging directly and does not implement the ICollection interface, the GridView control cannot page. For example, if you are using a SqlDataSource control and have set its DataSourceMode property to DataReader, the GridView control cannot implement paging."
I confirmed this in the code, and when switching to DataSet mode, it doesn't even bother to go into your 'custom' paging properties (StartRecordParameterName or MaxRecordsParameterName) because the CanPage property is false because these properties are empty.

Basically I'm not understanding the logic behind the custom paging properties due to the fact that paging works by simply setting the datasourcemode to DataSet, and in doing so makes your custom paging properties useless..

 
Old April 3rd, 2007, 09:12 AM
Authorized User
 
Join Date: Sep 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or, your paging properties must be for custom paging with SP's I assume...

 
Old April 3rd, 2007, 01:54 PM
Wrox Author
 
Join Date: Aug 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, studen77,
  As I mentioned in my response to one of your previous postings, the implementation of the SqlDataSource control presented in this book extends the functionality of the standard SqlDataSource control to add support for paging. As such, the paging related properties of this custom SqlDataSource are custom properties.

Cheers!
Shahram

-----------------------
Shahram Khosravi, Ph.D.
Author of Professional ASP.NET 2.0 Server Control and Component Development
 
Old April 3rd, 2007, 02:43 PM
Authorized User
 
Join Date: Sep 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok Dr.-

You didn't even bother to read my post. I'll quote myself:
Quote:
quote:I confirmed this in the code, and when switching to DataSet mode, it doesn't even bother to go into your 'custom' paging properties (StartRecordParameterName or MaxRecordsParameterName) because the CanPage property is false because these properties are empty.
I've since went back to DataReader mode and wrote a stored procedure that allows for paging (am I going in the right direction?)

Basically I'm trying to understand how your custom sqldatasource allows for paging with controls such as the GridView...(if this is even possible) and if so, how it works.

Correct me if I'm even going in the right direction but I understand The DataGrid does allow for custom paging, and I suppose I could delve into implementing this through your custom sqldatasource control- but again, I'm not understanding how.

 
Old April 3rd, 2007, 02:53 PM
jminatel's Avatar
Wrox Staff
Points: 18,059, Level: 58
Points: 18,059, Level: 58 Points: 18,059, Level: 58 Points: 18,059, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
Default

Studen77: "You didn't even bother to read my post. I'll quote myself:" Please remind yourself to be more than civil here. Our authors are under no obligation to help readers but they do because they enjoy it. You won't find many other publishers with as many authors as Wrox doing this and you won't find many authors who are more dedicated to it than Dr. Khosravi. (OK, Imar is super-dedicated, we all know that.<g>) But it would be a great loss to all readers here if rude responses in the forum undermined an author's motivation to help his readers. Thanks for your consideration.

Jim Minatel
Senior Acquisitions Editor
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Jim's Book of the week: No book this week - Donate to the Red Cross!
 
Old April 3rd, 2007, 04:34 PM
Wrox Author
 
Join Date: Aug 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, studen77,
   As I've discussed in Chapter 19, there're two types of paging: custom and server-side. The custom paging feature is specifically designed to support custom paging of the DataGrid control. Basically, the ASP.NET 2.0 Framework moved away from custom paging. That is why none of the new ASP.NET 2.0 databound server controls such as GridView support custom paging. Instead they support the second type of paging, which is known as server-side paging.

  Chapter 19 offers an "under the hood" view of server-side paging in GridView and shows how the new ASP.NET 2.0 data source controls such as SqlDataSource and data bound controls such as GridView work together to support server-side paging.

Cheers!
Shahram



-----------------------
Shahram Khosravi, Ph.D.
Author of Professional ASP.NET 2.0 Server Control and Component Development
 
Old April 4th, 2007, 12:14 PM
Authorized User
 
Join Date: Sep 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

jminatel:

I'm not here to badmouth the author - the bottom line is that I understand the code and explanations that he offers in the text.

In using the custom SqlDataSource control with its StartRecordParameterName and MaxRecordsParameterName values with a GridView, The GridView is not initializing the DataSourceSelectArguments.StartRowIndex or MaximumRows values

So the ExecuteSelect.RetrieveRows.SetDbParameters method in the custom SqlDataSource object is not setting these values and thus paging is not working properly. You indicate that data-bound controls must set both of these values. Are developers to set these values manually? If so, how? If not, how/where to data-bound controls (such as GridView) set them?

The GridView calls the select statement from its datasource automatically and passes whatever DataSourceSelectArguments it needs into it, correct?

 
Old April 4th, 2007, 03:45 PM
Authorized User
 
Join Date: Sep 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by khosravi
 Hi, studen77,
   As I've discussed in Chapter 19, there're two types of paging: custom and server-side. The custom paging feature is specifically designed to support custom paging of the DataGrid control. Basically, the ASP.NET 2.0 Framework moved away from custom paging. That is why none of the new ASP.NET 2.0 databound server controls such as GridView support custom paging. Instead they support the second type of paging, which is known as server-side paging.

  Chapter 19 offers an "under the hood" view of server-side paging in GridView and shows how the new ASP.NET 2.0 data source controls such as SqlDataSource and data bound controls such as GridView work together to support server-side paging.

Cheers!
Shahram



-----------------------
Shahram Khosravi, Ph.D.
Author of Professional ASP.NET 2.0 Server Control and Component Development
Ok. I'll have to jump to chapter 19. I was reading the chapters in logical order and was in Chp.14

 
Old April 4th, 2007, 05:49 PM
Wrox Author
 
Join Date: Aug 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by studen77
 
Quote:
quote:Originally posted by khosravi
Quote:
 Hi, studen77,
As I've discussed in Chapter 19, there're two types of paging: custom and server-side. The custom paging feature is specifically designed to support custom paging of the DataGrid control. Basically, the ASP.NET 2.0 Framework moved away from custom paging. That is why none of the new ASP.NET 2.0 databound server controls such as GridView support custom paging. Instead they support the second type of paging, which is known as server-side paging.

Chapter 19 offers an "under the hood" view of server-side paging in GridView and shows how the new ASP.NET 2.0 data source controls such as SqlDataSource and data bound controls such as GridView work together to support server-side paging.

Cheers!
Shahram



-----------------------
Shahram Khosravi, Ph.D.
Author of Professional ASP.NET 2.0 Server Control and Component Development
Ok. I'll have to jump to chapter 19. I was reading the chapters in logical order and was in Chp.14

Hi, studen77,
   Chapters are in logical order. Chapters 12 through 16 present the ASP.NET 2.0 data source control model where readers learn a great deal about tabular and hierarchical data source controls and how to develop their own custom data source controls.

   Chapters 17 through 19 present the ASP.NET 2.0 data bound control model where readers learn how to develop custom tabular data bound controls as complex as GridView and how the ASP.NET 2.0 data bound control model uses the ASP.NET 2.0 data source control model to support data-related features such as paging, sorting, and so on regardless of whether the underlying data store is tabular or hierarchical.

Cheers!
Shahram :)

-----------------------
Shahram Khosravi, Ph.D.
Author of Professional ASP.NET 2.0 Server Control and Component Development





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql 2000 version of Chp.12 databases studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 2 December 2nd, 2015 01:42 PM
Chp.12 SqlDataSource.SelectCountCommand ??? studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 4 March 7th, 2007 02:50 PM
Chp.12 SqlDataSourceView 'owner' property studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 March 6th, 2007 02:58 PM
Chp 12, common_db.inc & userviewer.php reques jaymax BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 February 1st, 2006 05:18 PM
Chp 12 - userviewer.php problems w/ hyperlinks jaymax BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 July 10th, 2003 04:54 PM





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