Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 November 11th, 2006, 04:08 PM
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble displaying DetailsView & FormView

I am new to ASP.NET and purchased the book "ASP.NET 2.0 Visual Web Developer 2005 Express Edition - Starter Kit" by Wrox (of course). I tried the exercise on pgs 123-126, which is to place a DetailsView control and a FormView control on a web page. When I run it, the FormView does not appear. In an attempt to find the problem, I tried many different things, including leaving out the FormView control, etc. Sometimes the DetailsView control does not appear! I have not found a pattern to allow me to solve this. Can you please help??? I have a timeline for a project that is running out.

Here is one iteration of my attempts to solve this issue and it only displays the header, not the DetailsView control:



<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestAgain.aspx.vb" Inherits="TestAgain" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Title of The Page<br />
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PPQ_DataConnectionString1 %>"
            DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @original_OrderID AND [Name] = @original_Name AND [Address] = @original_Address AND [ZipCode] = @original_ZipCode AND [OrderDate] = @original_OrderDate AND [DeliveryCharge] = @original_DeliveryCharge AND [TotalValue] = @original_TotalValue" InsertCommand="INSERT INTO [Orders] ([Name], [Address], [ZipCode], [OrderDate], [DeliveryCharge], [TotalValue]) VALUES (@Name, @Address, @ZipCode, @OrderDate, @DeliveryCharge, @TotalValue)"
            SelectCommand="SELECT * FROM [Orders]" UpdateCommand="UPDATE [Orders] SET [Name] = @Name, [Address] = @Address, [ZipCode] = @ZipCode, [OrderDate] = @OrderDate, [DeliveryCharge] = @DeliveryCharge, [TotalValue] = @TotalValue WHERE [OrderID] = @original_OrderID AND [Name] = @original_Name AND [Address] = @original_Address AND [ZipCode] = @original_ZipCode AND [OrderDate] = @original_OrderDate AND [DeliveryCharge] = @original_DeliveryCharge AND [TotalValue] = @original_TotalValue" ConflictDetection="CompareAllValues" OldValuesParameterFormatString="original_{0}">
            <DeleteParameters>
                <asp:Parameter Name="original_OrderID" Type="Int32" />
                <asp:Parameter Name="original_Name" Type="String" />
                <asp:Parameter Name="original_Address" Type="String" />
                <asp:Parameter Name="original_ZipCode" Type="String" />
                <asp:Parameter Name="original_OrderDate" Type="DateTime" />
                <asp:Parameter Name="original_DeliveryCharge" Type="Decimal" />
                <asp:Parameter Name="original_TotalValue" Type="Decimal" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Address" Type="String" />
                <asp:Parameter Name="ZipCode" Type="String" />
                <asp:Parameter Name="OrderDate" Type="DateTime" />
                <asp:Parameter Name="DeliveryCharge" Type="Decimal" />
                <asp:Parameter Name="TotalValue" Type="Decimal" />
                <asp:Parameter Name="original_OrderID" Type="Int32" />
                <asp:Parameter Name="original_Name" Type="String" />
                <asp:Parameter Name="original_Address" Type="String" />
                <asp:Parameter Name="original_ZipCode" Type="String" />
                <asp:Parameter Name="original_OrderDate" Type="DateTime" />
                <asp:Parameter Name="original_DeliveryCharge" Type="Decimal" />
                <asp:Parameter Name="original_TotalValue" Type="Decimal" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Address" Type="String" />
                <asp:Parameter Name="ZipCode" Type="String" />
                <asp:Parameter Name="OrderDate" Type="DateTime" />
                <asp:Parameter Name="DeliveryCharge" Type="Decimal" />
                <asp:Parameter Name="TotalValue" Type="Decimal" />
            </InsertParameters>
        </asp:SqlDataSource>

    </div>
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
            DataSourceID="SqlDataSource1" Height="50px" Width="125px" AllowPaging="True">
            <Fields>
                <asp:BoundField DataField="OrderID" HeaderText="OrderID" ReadOnly="True"
                    SortExpression="OrderID" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                <asp:BoundField DataField="ZipCode" HeaderText="ZipCode" SortExpression="ZipCode" />
                <asp:BoundField DataField="OrderDate" HeaderText="OrderDate" SortExpression="OrderDate" />
                <asp:BoundField DataField="DeliveryCharge" HeaderText="DeliveryCharge" SortExpression="DeliveryCharge" NullDisplayText="0.00" />
                <asp:BoundField DataField="TotalValue" HeaderText="TotalValue" SortExpression="TotalValue" />
            </Fields>
        </asp:DetailsView>
        <br />
    </form>
</body>
</html>





What am I doing wrong??? Any suggestions would be GREATLY WELCOME AND APPRECIATED!!!

Thanks so much!!
Sheri B





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB GridView & DetailsView Rich57 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 February 1st, 2008 12:03 PM
Displaying DetailsView for New/Empty Data Table Sheri B ASP.NET 2.0 Basics 5 December 7th, 2006 03:08 PM
Trouble displaying Data Grid control bam1934 ASP.NET 1.0 and 1.1 Basics 4 May 25th, 2005 07:59 AM
trouble displaying data from array Arsi C# 1 October 22nd, 2004 04:13 PM
Having trouble displaying txt doc on WinForm tpsmith78 VS.NET 2002/2003 1 January 22nd, 2004 12:35 PM





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