Wrox Programmer Forums
|
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 February 16th, 2007, 12:48 PM
Registered User
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datalist not Updating..

Hi, I'm just fighting now with my datalist, its not updating anymore!, i click on update button and this just keeps old values! here is the code:

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="id"
        DataSourceID="SqlDataSource2" DefaultMode="Edit" Height="50px" Width="125px">
        <Fields>
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                SortExpression="id" />
            <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" />
            <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
            <asp:BoundField DataField="address" HeaderText="address" SortExpression="address" />
            <asp:BoundField DataField="area" HeaderText="area" SortExpression="area" />
            <asp:BoundField DataField="metroStop" HeaderText="metroStop" SortExpression="metroStop" />
            <asp:BoundField DataField="town" HeaderText="town" SortExpression="town" />
            <asp:BoundField DataField="postcode" HeaderText="postcode" SortExpression="postcode" />
            <asp:BoundField DataField="country" HeaderText="country" SortExpression="country" />
            <asp:BoundField DataField="phone" HeaderText="phone" SortExpression="phone" />
            <asp:BoundField DataField="fax" HeaderText="fax" SortExpression="fax" />
            <asp:BoundField DataField="website" HeaderText="website" SortExpression="website" />
            <asp:BoundField DataField="type" HeaderText="type" SortExpression="type" />
            <asp:BoundField DataField="business" HeaderText="business" SortExpression="business" />
            <asp:BoundField DataField="discName" HeaderText="discName" SortExpression="discName" />
            <asp:BoundField DataField="discDesc" HeaderText="discDesc" SortExpression="discDesc" />
            <asp:BoundField DataField="opening" HeaderText="opening" SortExpression="opening" />
            <asp:BoundField DataField="longDesc" HeaderText="longDesc" SortExpression="longDesc" />
            <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
            <asp:BoundField DataField="internalSite" HeaderText="internalSite" SortExpression="internalSite" />
            <asp:BoundField DataField="logo" HeaderText="logo" SortExpression="logo" />
            <asp:BoundField DataField="photo1" HeaderText="photo1" SortExpression="photo1" />
            <asp:BoundField DataField="photo2" HeaderText="photo2" SortExpression="photo2" />
            <asp:BoundField DataField="photo3" HeaderText="photo3" SortExpression="photo3" />
            <asp:CommandField ButtonType="Button" ShowEditButton="True" UpdateText="Update!" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:ConnectWebConnectionString4 %>" DeleteCommand="DELETE FROM [Discounts] WHERE [id] = @original_id AND [CompanyName] = @original_CompanyName AND [email] = @original_email AND [address] = @original_address AND [area] = @original_area AND [metroStop] = @original_metroStop AND [town] = @original_town AND [postcode] = @original_postcode AND [country] = @original_country AND [phone] = @original_phone AND [fax] = @original_fax AND [website] = @original_website AND [type] = @original_type AND [business] = @original_business AND [discName] = @original_discName AND [discDesc] = @original_discDesc AND [opening] = @original_opening AND [longDesc] = @original_longDesc AND [Description] = @original_Description AND [internalSite] = @original_internalSite AND [logo] = @original_logo AND [photo1] = @original_photo1 AND [photo2] = @original_photo2 AND [photo3] = @original_photo3"
        InsertCommand="INSERT INTO [Discounts] ([CompanyName], [email], [address], [area], [metroStop], [town], [postcode], [country], [phone], [fax], [website], [type], [business], [discName], [discDesc], [opening], [longDesc], [Description], [internalSite], [logo], [photo1], [photo2], [photo3]) VALUES (@CompanyName, @email, @address, @area, @metroStop, @town, @postcode, @country, @phone, @fax, @website, @type, @business, @discName, @discDesc, @opening, @longDesc, @Description, @internalSite, @logo, @photo1, @photo2, @photo3)"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Discounts] WHERE ([CompanyName] = @CompanyName)"
        UpdateCommand="UPDATE [Discounts] SET [CompanyName] = @CompanyName, [email] = @email, [address] = @address, [area] = @area, [metroStop] = @metroStop, [town] = @town, [postcode] = @postcode, [country] = @country, [phone] = @phone, [fax] = @fax, [website] = @website, [type] = @type, [business] = @business, [discName] = @discName, [discDesc] = @discDesc, [opening] = @opening, [longDesc] = @longDesc, [Description] = @Description, [internalSite] = @internalSite, [logo] = @logo, [photo1] = @photo1, [photo2] = @photo2, [photo3] = @photo3 WHERE [id] = @original_id AND [CompanyName] = @original_CompanyName AND [email] = @original_email AND [address] = @original_address AND [area] = @original_area AND [metroStop] = @original_metroStop AND [town] = @original_town AND [postcode] = @original_postcode AND [country] = @original_country AND [phone] = @original_phone AND [fax] = @original_fax AND [website] = @original_website AND [type] = @original_type AND [business] = @original_business AND [discName] = @original_discName AND [discDesc] = @original_discDesc AND [opening] = @original_opening AND [longDesc] = @original_longDesc AND [Description] = @original_Description AND [internalSite] = @original_internalSite AND [logo] = @original_logo AND [photo1] = @original_photo1 AND [photo2] = @original_photo2 AND [photo3] = @original_photo3">
        <DeleteParameters>
            <asp:Parameter Name="original_id" Type="Int32" />
            <asp:Parameter Name="original_CompanyName" Type="String" />
            <asp:Parameter Name="original_email" Type="String" />
            <asp:Parameter Name="original_address" Type="String" />
            <asp:Parameter Name="original_area" Type="String" />
            <asp:Parameter Name="original_metroStop" Type="String" />
            <asp:Parameter Name="original_town" Type="String" />
            <asp:Parameter Name="original_postcode" Type="String" />
            <asp:Parameter Name="original_country" Type="String" />
            <asp:Parameter Name="original_phone" Type="String" />
            <asp:Parameter Name="original_fax" Type="String" />
            <asp:Parameter Name="original_website" Type="String" />
            <asp:Parameter Name="original_type" Type="String" />
            <asp:Parameter Name="original_business" Type="String" />
            <asp:Parameter Name="original_discName" Type="String" />
            <asp:Parameter Name="original_discDesc" Type="String" />
            <asp:Parameter Name="original_opening" Type="String" />
            <asp:Parameter Name="original_longDesc" Type="String" />
            <asp:Parameter Name="original_Description" Type="String" />
            <asp:Parameter Name="original_internalSite" Type="String" />
            <asp:Parameter Name="original_logo" Type="String" />
            <asp:Parameter Name="original_photo1" Type="String" />
            <asp:Parameter Name="original_photo2" Type="String" />
            <asp:Parameter Name="original_photo3" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="address" Type="String" />
            <asp:Parameter Name="area" Type="String" />
            <asp:Parameter Name="metroStop" Type="String" />
            <asp:Parameter Name="town" Type="String" />
            <asp:Parameter Name="postcode" Type="String" />
            <asp:Parameter Name="country" Type="String" />
            <asp:Parameter Name="phone" Type="String" />
            <asp:Parameter Name="fax" Type="String" />
            <asp:Parameter Name="website" Type="String" />
            <asp:Parameter Name="type" Type="String" />
            <asp:Parameter Name="business" Type="String" />
            <asp:Parameter Name="discName" Type="String" />
            <asp:Parameter Name="discDesc" Type="String" />
            <asp:Parameter Name="opening" Type="String" />
            <asp:Parameter Name="longDesc" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="internalSite" Type="String" />
            <asp:Parameter Name="logo" Type="String" />
            <asp:Parameter Name="photo1" Type="String" />
            <asp:Parameter Name="photo2" Type="String" />
            <asp:Parameter Name="photo3" Type="String" />
            <asp:Parameter Name="original_id" Type="Int32" />
            <asp:Parameter Name="original_CompanyName" Type="String" />
            <asp:Parameter Name="original_email" Type="String" />
            <asp:Parameter Name="original_address" Type="String" />
            <asp:Parameter Name="original_area" Type="String" />
            <asp:Parameter Name="original_metroStop" Type="String" />
            <asp:Parameter Name="original_town" Type="String" />
            <asp:Parameter Name="original_postcode" Type="String" />
            <asp:Parameter Name="original_country" Type="String" />
            <asp:Parameter Name="original_phone" Type="String" />
            <asp:Parameter Name="original_fax" Type="String" />
            <asp:Parameter Name="original_website" Type="String" />
            <asp:Parameter Name="original_type" Type="String" />
            <asp:Parameter Name="original_business" Type="String" />
            <asp:Parameter Name="original_discName" Type="String" />
            <asp:Parameter Name="original_discDesc" Type="String" />
            <asp:Parameter Name="original_opening" Type="String" />
            <asp:Parameter Name="original_longDesc" Type="String" />
            <asp:Parameter Name="original_Description" Type="String" />
            <asp:Parameter Name="original_internalSite" Type="String" />
            <asp:Parameter Name="original_logo" Type="String" />
            <asp:Parameter Name="original_photo1" Type="String" />
            <asp:Parameter Name="original_photo2" Type="String" />
            <asp:Parameter Name="original_photo3" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="CompanyName" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="address" Type="String" />
            <asp:Parameter Name="area" Type="String" />
            <asp:Parameter Name="metroStop" Type="String" />
            <asp:Parameter Name="town" Type="String" />
            <asp:Parameter Name="postcode" Type="String" />
            <asp:Parameter Name="country" Type="String" />
            <asp:Parameter Name="phone" Type="String" />
            <asp:Parameter Name="fax" Type="String" />
            <asp:Parameter Name="website" Type="String" />
            <asp:Parameter Name="type" Type="String" />
            <asp:Parameter Name="business" Type="String" />
            <asp:Parameter Name="discName" Type="String" />
            <asp:Parameter Name="discDesc" Type="String" />
            <asp:Parameter Name="opening" Type="String" />
            <asp:Parameter Name="longDesc" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="internalSite" Type="String" />
            <asp:Parameter Name="logo" Type="String" />
            <asp:Parameter Name="photo1" Type="String" />
            <asp:Parameter Name="photo2" Type="String" />
            <asp:Parameter Name="photo3" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>


I just dont know what more do!, i did it all over it just dont update! =(






Similar Threads
Thread Thread Starter Forum Replies Last Post
Datalist inside datalist amit.jagtap ASP.NET 2.0 Professional 1 September 4th, 2007 05:03 AM
DataList HELP with Updating zoltac007 ASP.NET 2.0 Basics 0 February 16th, 2007 03:47 AM
datalist sarah lee ASP.NET 1.0 and 1.1 Basics 0 October 18th, 2006 02:49 PM
Updating boolean values using datalist Scripts82 ASP.NET 1.0 and 1.1 Basics 1 September 20th, 2006 04:17 AM
DataList in DataList acko ASP.NET 1.0 and 1.1 Professional 3 July 9th, 2004 05:18 PM





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