Wrox Programmer Forums
|
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 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 September 12th, 2010, 08: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'
 
Old September 13th, 2010, 02:48 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old September 13th, 2010, 12: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>
 
Old September 13th, 2010, 03:08 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old September 17th, 2010, 11:45 AM
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
 
Old September 17th, 2010, 11:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old September 17th, 2010, 11:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old September 17th, 2010, 12: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
 
Old September 17th, 2010, 12:36 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!





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 04: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 03: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 08: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 08:22 PM





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