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: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 12th, 2010, 09:16 PM
Registered User
 
Join Date: Jun 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 Page 470 Step 14

In Chapter 13 Page 470 Step 14

I do not receive any build errors but when I run the file in the browser I receive this error. Can someone please explain?






Operator '==' incompatible with operand types 'Int32' and 'Object'
Reply With Quote
  #2 (permalink)  
Old September 13th, 2010, 03:48 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,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

Hi there,

Can you post the code for the page that throws the error?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old September 13th, 2010, 01:15 PM
Registered User
 
Join Date: Jun 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Here's my Chapter 13 page 470 step 14 code

<%@ Page Title="All Photo Albums" Language="VB" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<script runat="server">
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
</asp:UpdatePanel>
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedInde xChanged">
</asp:DropDownList>
<asp:ListView ID="ListView1" runat="server" DataKeyNames="Id"
DataSourceID="LinqDataSource1">
<ItemTemplate>
<li> <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImageUrl") %>'
ToolTip='<%# Eval("ToolTip") %>' />
<asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' />
</li>
</ItemTemplate>
<EmptyDataTemplate>
No data was returned.
</EmptyDataTemplate>
<LayoutTemplate>
<ul class="itemContainer">
<li ID="itemPlaceholder" runat="server" />
</ul>
<div style="">
<asp:DataPager ID="DataPager1" runat="server" PageSize="3">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
</Fields>
</asp:DataPager>
</div>
</LayoutTemplate>
</asp:ListView>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="PlanetWroxDataContext" TableName="Pictures"
Where="PhotoAlbumId == @PhotoAlbumId">
<WhereParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="PhotoAlbumId"
PropertyName="SelectedValue" Type="Int32" />
</WhereParameters>
</asp:LinqDataSource>
</asp:ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Reply With Quote
  #4 (permalink)  
Old September 13th, 2010, 04:08 PM
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,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

I don't see any data in the DropDownList, nor a data source. Try hooking it up to a data source and add an item with a value of 0 (zero) and a text like "Select an item".

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #5 (permalink)  
Old September 17th, 2010, 12:45 PM
Registered User
 
Join Date: Jun 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 page 470 Step 14

Imar,
I do have a dropdown list that is hooked up to a datasource which was in step 2 on page 467. I have included 2 screenshots in a seperate email I sent to you through a yahoo account, one which shows the datasource in design view. If I try to re-do step 2 without taking the page down and starting over it shows I must use datasource 2 since datasource 1 is already being used.
Bagellady
Reply With Quote
  #6 (permalink)  
Old September 17th, 2010, 12:52 PM
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,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

Where did you send the message to?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #7 (permalink)  
Old September 17th, 2010, 12:54 PM
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,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

BTW, not sure what you mean with this:
Quote:
it shows I must use datasource 2 since datasource 1 is already being used
You can reuse data source controls for different data-bound controls.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #8 (permalink)  
Old September 17th, 2010, 01:32 PM
Registered User
 
Join Date: Jun 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 page 470 Step 14

Imar,

I've already connected my drop down list to a data source from the exercise on page 467 but when I run the code it brings up that == error. Sorry you didn't get my whole message. You asked where I sent my reply to. I got a response from you through my yahoo email account so I replied to it through yahoo as a reply because I sent you some screenshots including the design view that shows the dropdown list and the datasource and I'm not seeing where there is an attachment button or paperclip in this wrox reply section.
Bagellady
Reply With Quote
  #9 (permalink)  
Old September 17th, 2010, 01:36 PM
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,960
Thanks: 79
Thanked 1,559 Times in 1,536 Posts
Default

I haven't sent you a response; the Wrox P2P forum probably did, so you probably just replied to the forum administrator....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


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
Chapter 15.page 532.step 5 leemark2k3 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 8 September 13th, 2010 05:19 PM
Chapter 5 page 156 Example Step 4 NoraBelle BOOK: Professional Microsoft SQL Server 2008 Integration Services ISBN: 978-0-470-24795-2 1 August 2nd, 2010 04:29 PM
Try it out, Chapter 20, page 684, step 3 ron-bgsu BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 0 October 28th, 2009 09:52 AM
Try it Out Chapter 18 Page 587 Step 4 workib BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 0 November 6th, 2008 02:01 PM
Chapter 16 Try It Out Page 498 Step 7 workib BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 1 October 9th, 2008 09:22 PM



All times are GMT -4. The time now is 07:46 PM.


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