Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > All Other Wrox Books
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books 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
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 18th, 2004, 07:58 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 workjokeshop

Public Class DepartmentsList
    Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents list As System.Web.UI.WebControls.DataList

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim listIndex As String = Request.Params("departmentIndex")

        ' If listIndex has a value, this tells us that the visitor
        ' has clicked on a department, and we inform the DataList about that
        ' (so it can apply the correct template for the selected item)
        If Not listIndex Is Nothing Then
            list.SelectedIndex = CInt(listIndex)
        End If

        ' Create a new Catalog object
       Dim catalog As New Catalog

        ' GetDepartments returns a SqlDataReader object that has
        ' two fields: DepartmentID and Name. These fields are read in
        ' the SelectedItemTemplate and ItemTemplate of the DataList
        list.DataSource = catalog.GetDepartments()

        ' Needed to bind the child controls (the HyperLink controls)
        ' to the data source
        list.DataBind()
    End Sub

End Class

when i tried 2 build the solution it comes up with
The'catalog' is not defined

  #2 (permalink)  
Old February 18th, 2004, 07:59 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry thats not the code here it is


Public Class DepartmentsList
    Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents list As System.Web.UI.WebControls.DataList

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim listIndex As String = Request.Params("departmentIndex")

        ' If listIndex has a value, this tells us that the visitor
        ' has clicked on a department, and we inform the DataList about that
        ' (so it can apply the correct template for the selected item)
        If Not listIndex Is Nothing Then
            list.SelectedIndex = CInt(listIndex)
        End If

        ' Create a new Catalog object
        Dim catalog As New Catalog

        ' GetDepartments returns a SqlDataReader object that has
        ' two fields: DepartmentID and Name. These fields are read in
        ' the SelectedItemTemplate and ItemTemplate of the DataList
        list.DataSource = catalog.GetDepartments()

        ' Needed to bind the child controls (the HyperLink controls)
        ' to the data source
        list.DataBind()
    End Sub

End Class

  #3 (permalink)  
Old February 19th, 2004, 01:24 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok ive sorted!!! i called the catalog.vb clatalog which is why it didnt reconize it OOPS that had me stumped for hours!!

Closed Thread


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
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
chapter 7 - chapter 11 pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 January 6th, 2008 11:40 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM



All times are GMT -4. The time now is 11:28 PM.


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