Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 Display Modes
  #1 (permalink)  
Old August 5th, 2007, 03:18 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch1, why using CollectionBase class?

Hi,

 I purchased this great book and I must say it's one of the best books around. Although it could be better by explaining the complete solution step-by-step but I guess it's not for beginners.

In Chapter 1 I saw the authors using the CollectionBase class, why? can't we just use the Generic classes?

one more issue: the stored procedure
CREATE PROC InsertDiaryEntry
(
    @DiaryId INT,
    @EntryDate DATETIME,
    @EntryTitle NVARCHAR(50),
    @EntryText NVARCHAR(2000),
    @NewDiaryEntryId BIGINT = -1 OUTPUT
)
AS
INSERT INTO DiaryEntry (DiaryId, EntryDate, EntryTitle, EntryText)
VALUES(@DiaryId, @EntryDate, @EntryTitle, @EntryText)
RETURN @@IDENTITY

Uses OUTPUT parameter to set the value of @NewDiaryEntryId and also return the same value I don't understand why the authors did that?
Help please

  #2 (permalink)  
Old August 5th, 2007, 05:40 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,957
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

Hi there,

One of the goals of the book is to show different ways to accomplish things. While generic classes are extremely useful in most scenarios, there are also situations where it makes sense to create your own collection class. This is shown with the ContactCollection class. However, the code would have worked equally well with a List (Of Contact) generics list or another generic collection.

With regards to the procedure, I think it's a bug. I didn't write that chapter, so I am not 100% sure about the reasoning behind the code, but as far as I can tell, you can drop the OUTPUT param. E.g. the following (untested) should work as well:

SPROC

 @EntryText NVARCHAR(2000)<s>,
    @NewDiaryEntryId BIGINT = -1 OUTPUT</s>
)

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #3 (permalink)  
Old August 5th, 2007, 06:34 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Imar,

Thanks for your help. I will try to use Generics later.

  #4 (permalink)  
Old August 5th, 2007, 07:32 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,957
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

Yeah, later chapters (WebShop, BugBase and others) use Generics a lot more.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 


Thread Tools
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
Possible Error? - CH1 Regiser.php ArthurDent BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 2 August 12th, 2008 03:50 AM
Ch1 MySQL returns Error 1046: No database selected aiche_ag BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 October 1st, 2007 03:47 PM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Regarding Class Library (.dll) from class file manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 March 3rd, 2006 07:32 AM
How to include c# class and vb class in the .vbprj umeshayk VS.NET 2002/2003 2 January 9th, 2004 12:08 AM



All times are GMT -4. The time now is 10:47 AM.


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