Click here to Skip to main content
15,912,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:AccessDataSource ID="productsubtype" Runat="server" DataFile="~/access_db/db_tables.mdb"
          SelectCommand="SELECT [type], [id],[subtype] FROM [prod_subtype]"

             UpdateCommand="UPDATE [prod_subtype] SET [subtype]=@subtype WHERE [id]=@id"
             <big></big>DeleteCommand="DELETE FROM [prod_subtype] WHERE [id]=@id"
              FilterExpression="type='{0}'">

              <UpdateParameters>

                  <asp:Parameter Name="subtype" Type="string" />
              </UpdateParameters>
              <DeleteParameters>
                  <asp:Parameter Name="id" Type="string" />
              </DeleteParameters>
               <FilterParameters>
              <asp:ControlParameter Name="type" DefaultValue="-1"
                 Type="String" ControlID="gdproducttype"
                  PropertyName="SelectedValue"></asp:ControlParameter>
          </FilterParameters>
      </asp:AccessDataSource>


When i press delete button in gridview i am getting error updating happened properly
Posted
Updated 24-Jun-11 0:43am
v4

1 solution

I think you need to give value for id in Updateparameters
XML
<updateparameters>
<asp:parameter name="subtype" type="string" />
<asp:parameter name="id" type="string" />
</updateparameters>


EDIT
------------------------
You need to add another parameter value for Update command because there are two parameters @subtype and @id. So add the below line inside the Updateparameters
<asp:parameter name="id" type="string" />
 
Share this answer
 
v3
Comments
evigneesh 24-Jun-11 5:13am    
I is not Working
thatraja 24-Jun-11 5:18am    
Not clear, what error?
evigneesh 24-Jun-11 5:21am    
No value given for one or more required parameters ,I am getting this error, is my delete state is correct are not
thatraja 24-Jun-11 5:27am    
check my updated answer
evigneesh 24-Jun-11 5:30am    
Ok Update command working fine delete statement also having problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900