Link to home
Start Free TrialLog in
Avatar of centem
centemFlag for United States of America

asked on

Unable to delete or update ASP GridView

Please help. Why won't this gridview delete when I click on the delete button or update when I click on the update button. Below is the entire gridview code.
 
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
             AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="id"
             DataSourceID="SqlDataSource1">
             <Columns>
                 <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                 <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False"
                     ReadOnly="True" SortExpression="id" Visible="False" />
                 <asp:BoundField DataField="Userid" HeaderText="Userid" ReadOnly="True"
                     SortExpression="Userid" />
                 <asp:BoundField DataField="FirstN" HeaderText="FirstN" ReadOnly="True"
                     SortExpression="FirstN" />
                 <asp:BoundField DataField="LastN" HeaderText="LastN" ReadOnly="True"
                     SortExpression="LastN" />
                 <asp:BoundField DataField="MiddleI" HeaderText="MiddleI" ReadOnly="True"
                     SortExpression="MiddleI" />
                 <asp:BoundField DataField="Location" HeaderText="Location" ReadOnly="True"
                     SortExpression="Location" />
                 <asp:BoundField DataField="IACertificationDate"
                     HeaderText="IACertificationDate" SortExpression="IACertificationDate" />
             </Columns>
         </asp:GridView>
         <asp:SqlDataSource ID="SqlDataSource1" runat="server"
             ConflictDetection="CompareAllValues"
             ConnectionString="<%$ ConnectionStrings:nodiiguard_u2kdbConnectionString %>"
             DeleteCommand="DELETE FROM [U2K_UserList] WHERE [id] = @original_id AND (([Userid] = @original_Userid) OR ([Userid] IS NULL AND @original_Userid IS NULL)) AND (([FirstN] = @original_FirstN) OR ([FirstN] IS NULL AND @original_FirstN IS NULL)) AND (([LastN] = @original_LastN) OR ([LastN] IS NULL AND @original_LastN IS NULL)) AND (([MiddleI] = @original_MiddleI) OR ([MiddleI] IS NULL AND @original_MiddleI IS NULL)) AND (([Location] = @original_Location) OR ([Location] IS NULL AND @original_Location IS NULL)) AND (([IACertificationDate] = @original_IACertificationDate) OR ([IACertificationDate] IS NULL AND @original_IACertificationDate IS NULL))"
             InsertCommand="INSERT INTO [U2K_UserList] ([Userid], [FirstN], [LastN], [MiddleI], [Location], [IACertificationDate]) VALUES (@Userid, @FirstN, @LastN, @MiddleI, @Location, @IACertificationDate)"
             OldValuesParameterFormatString="original_{0}"
             SelectCommand="SELECT [id], [Userid], [FirstN], [LastN], [MiddleI], [Location], [IACertificationDate] FROM [U2K_UserList]"
             UpdateCommand="UPDATE [U2K_UserList] SET [Userid] = @Userid, [FirstN] = @FirstN, [LastN] = @LastN, [MiddleI] = @MiddleI, [Location] = @Location, [IACertificationDate] = @IACertificationDate WHERE [id] = @original_id AND (([Userid] = @original_Userid) OR ([Userid] IS NULL AND @original_Userid IS NULL)) AND (([FirstN] = @original_FirstN) OR ([FirstN] IS NULL AND @original_FirstN IS NULL)) AND (([LastN] = @original_LastN) OR ([LastN] IS NULL AND @original_LastN IS NULL)) AND (([MiddleI] = @original_MiddleI) OR ([MiddleI] IS NULL AND @original_MiddleI IS NULL)) AND (([Location] = @original_Location) OR ([Location] IS NULL AND @original_Location IS NULL)) AND (([IACertificationDate] = @original_IACertificationDate) OR ([IACertificationDate] IS NULL AND @original_IACertificationDate IS NULL))">
             <DeleteParameters>
                 <asp:Parameter Name="original_id" Type="Int32" />
                 <asp:Parameter Name="original_Userid" Type="String" />
                 <asp:Parameter Name="original_FirstN" Type="String" />
                 <asp:Parameter Name="original_LastN" Type="String" />
                 <asp:Parameter Name="original_MiddleI" Type="String" />
                 <asp:Parameter Name="original_Location" Type="String" />
                 <asp:Parameter Name="original_IACertificationDate" Type="DateTime" />
             </DeleteParameters>
             <InsertParameters>
                 <asp:Parameter Name="Userid" Type="String" />
                 <asp:Parameter Name="FirstN" Type="String" />
                 <asp:Parameter Name="LastN" Type="String" />
                 <asp:Parameter Name="MiddleI" Type="String" />
                 <asp:Parameter Name="Location" Type="String" />
                 <asp:Parameter Name="IACertificationDate" Type="DateTime" />
             </InsertParameters>
             <UpdateParameters>
                 <asp:Parameter Name="Userid" Type="String" />
                 <asp:Parameter Name="FirstN" Type="String" />
                 <asp:Parameter Name="LastN" Type="String" />
                 <asp:Parameter Name="MiddleI" Type="String" />
                 <asp:Parameter Name="Location" Type="String" />
                 <asp:Parameter Name="IACertificationDate" Type="DateTime" />
                 <asp:Parameter Name="original_id" Type="Int32" />
                 <asp:Parameter Name="original_Userid" Type="String" />
                 <asp:Parameter Name="original_FirstN" Type="String" />
                 <asp:Parameter Name="original_LastN" Type="String" />
                 <asp:Parameter Name="original_MiddleI" Type="String" />
                 <asp:Parameter Name="original_Location" Type="String" />
                 <asp:Parameter Name="original_IACertificationDate" Type="DateTime" />
             </UpdateParameters>
         </asp:SqlDataSource>

SOLUTION
Avatar of srikanthreddyn143
srikanthreddyn143

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of centem

ASKER

Problem did not get fixed but will move on to other pending things.