DetailsView not updating record

saturation
saturation used Ask the Experts™
on
I have a DetailsView below that does not save the updates when I click the "Update" link below the form.   Why isn't it updating?
<form id="form1" runat="server">
    <div>
    
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="LeadFormsID" DataSourceID="SqlDataSource1" Height="50px" 
            Width="500px" DefaultMode="Edit" OnItemUpdated="DetailsView1_ItemUpdated">
            <Fields>
                <asp:ImageField DataImageUrlField="Image" 
                    DataImageUrlFormatString="~/Images/{0}.jpg" ControlStyle-Width="250" 
                    HeaderText="Image"> 
                   <ControlStyle Width="250px"></ControlStyle>
                </asp:ImageField>
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="Tagline" HeaderText="Tagline" 
                    SortExpression="Tagline" />
                <asp:BoundField DataField="Bullet1" HeaderText="Bullet1" 
                    SortExpression="Bullet1" />
                <asp:BoundField DataField="Bullet2" HeaderText="Bullet2" 
                    SortExpression="Bullet2" />
                <asp:BoundField DataField="Bullet3" HeaderText="Bullet3" 
                    SortExpression="Bullet3" />
                <asp:BoundField DataField="Bullet4" HeaderText="Bullet4" 
                    SortExpression="Bullet4" />
                <asp:BoundField DataField="Bullet5" HeaderText="Bullet5" 
                    SortExpression="Bullet5" />
                <asp:BoundField DataField="Bullet6" HeaderText="Bullet6" 
                    SortExpression="Bullet6" />
                <asp:BoundField DataField="Bullet7" HeaderText="Bullet7" 
                    SortExpression="Bullet7" />
                <asp:BoundField DataField="Bullet8" HeaderText="Bullet8" 
                    SortExpression="Bullet8" />
                <asp:BoundField DataField="Bullet9" HeaderText="Bullet9" 
                    SortExpression="Bullet9" />
                <asp:BoundField DataField="Bullet10" HeaderText="Bullet10" 
                    SortExpression="Bullet10" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="DateCreated" HeaderText="DateCreated" 
                    SortExpression="DateCreated" ReadOnly="true"  />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            </Fields>
        </asp:DetailsView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:LandingPageGeneratorConnectionString %>" 
            DeleteCommand="DELETE FROM [LeadForms] WHERE [LeadFormsID] = @LeadFormsID" 
            InsertCommand="INSERT INTO [LeadForms] ([Image], [Title], [Tagline], [Bullet1], [Bullet2], [Bullet3], [Bullet4], [Bullet5], [Bullet6], [Bullet7], [Bullet8], [Bullet9], [Bullet10], [Description], [DateCreated]) VALUES (@Image, @Title, @Tagline, @Bullet1, @Bullet2, @Bullet3, @Bullet4, @Bullet5, @Bullet6, @Bullet7, @Bullet8, @Bullet9, @Bullet10, @Description, @DateCreated)" 
            OldValuesParameterFormatString="{0}" 
            SelectCommand="SELECT * FROM [LeadForms] WHERE [LeadFormsID] = @LeadFormsID " 
            UpdateCommand="UPDATE [LeadForms] SET [Image] = @Image, [Title] = @Title, [Tagline] = @Tagline, [Bullet1] = @Bullet1, [Bullet2] = @Bullet2, [Bullet3] = @Bullet3, [Bullet4] = @Bullet4, [Bullet5] = @Bullet5, [Bullet6] = @Bullet6, [Bullet7] = @Bullet7, [Bullet8] = @Bullet8, [Bullet9] = @Bullet9, [Bullet10] = @Bullet10, [Description] = @Description, [DateCreated] = @DateCreated WHERE [LeadFormsID] = @LeadFormsID AND (([Image] = @Image) OR ([Image] IS NULL AND @Image IS NULL)) AND (([Title] = @Title) OR ([Title] IS NULL AND @Title IS NULL)) AND (([Tagline] = @Tagline) OR ([Tagline] IS NULL AND @Tagline IS NULL)) AND (([Bullet1] = @Bullet1) OR ([Bullet1] IS NULL AND @Bullet1 IS NULL)) AND (([Bullet2] = @Bullet2) OR ([Bullet2] IS NULL AND @Bullet2 IS NULL)) AND (([Bullet3] = @Bullet3) OR ([Bullet3] IS NULL AND @Bullet3 IS NULL)) AND (([Bullet4] = @Bullet4) OR ([Bullet4] IS NULL AND @Bullet4 IS NULL)) AND (([Bullet5] = @Bullet5) OR ([Bullet5] IS NULL AND @Bullet5 IS NULL)) AND (([Bullet6] = @Bullet6) OR ([Bullet6] IS NULL AND @Bullet6 IS NULL)) AND (([Bullet7] = @Bullet7) OR ([Bullet7] IS NULL AND @Bullet7 IS NULL)) AND (([Bullet8] = @Bullet8) OR ([Bullet8] IS NULL AND @Bullet8 IS NULL)) AND (([Bullet9] = @Bullet9) OR ([Bullet9] IS NULL AND @Bullet9 IS NULL)) AND (([Bullet10] = @Bullet10) OR ([Bullet10] IS NULL AND @Bullet10 IS NULL)) AND (([Description] = @Description) OR ([Description] IS NULL AND @Description IS NULL)) AND (([DateCreated] = @DateCreated) OR ([DateCreated] IS NULL AND @DateCreated IS NULL))">
            <selectparameters>
            <asp:QueryStringParameter Name="LeadFormsID" QueryStringField="LeadFormsID" /> 
            </selectparameters>
            <DeleteParameters>
                <asp:Parameter Name="Image" Type="String" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Tagline" Type="String" />
                <asp:Parameter Name="Bullet1" Type="String" />
                <asp:Parameter Name="Bullet2" Type="String" />
                <asp:Parameter Name="Bullet3" Type="String" />
                <asp:Parameter Name="Bullet4" Type="String" />
                <asp:Parameter Name="Bullet5" Type="String" />
                <asp:Parameter Name="Bullet6" Type="String" />
                <asp:Parameter Name="Bullet7" Type="String" />
                <asp:Parameter Name="Bullet8" Type="String" />
                <asp:Parameter Name="Bullet9" Type="String" />
                <asp:Parameter Name="Bullet10" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="DateCreated" Type="DateTime" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Image" Type="String" />
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Tagline" Type="String" />
                <asp:Parameter Name="Bullet1" Type="String" />
                <asp:Parameter Name="Bullet2" Type="String" />
                <asp:Parameter Name="Bullet3" Type="String" />
                <asp:Parameter Name="Bullet4" Type="String" />
                <asp:Parameter Name="Bullet5" Type="String" />
                <asp:Parameter Name="Bullet6" Type="String" />
                <asp:Parameter Name="Bullet7" Type="String" />
                <asp:Parameter Name="Bullet8" Type="String" />
                <asp:Parameter Name="Bullet9" Type="String" />
                <asp:Parameter Name="Bullet10" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="DateCreated" Type="DateTime" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Most likely is because of the where clause of the update query. Have you tried replacing the values and running it directly on SQL? What are you trying to do with the where clause?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial