Gridview rowupdating code behind

Rated 4.8/5 based on 751 customer reviews

Also I cannot find the field name in Grid View which is the same to the update parameter name. Hi payalp, The Update Parameters names are not equal to the names of New Values in Row Updating event. Sql Client" Select Command="select * from [spiderwebs_region] order by name " Update Command="Update Region With History" Update Command Type="Stored Procedure" Delete Command="Delete Region With History" Delete Command Type="Stored Procedure" On Inserting="Sqldatasource1_Inserting" On Inserted="Sqldatasource1_Inserted" Insert Command="Insert Region With History" Insert Command Type="Stored Procedure" Hi payalp, I suggest you assign the values to parameters directly in Row Updating event: Sql Data Source1. Sql Client" Select Command="select * from [spiderwebs_region] order by name " Update Command="Update Region With History" Update Command Type="Stored Procedure" Delete Command="Delete Region With History" Delete Command Type="Stored Procedure" On Inserting="Sqldatasource1_Inserting" On Inserted="Sqldatasource1_Inserted" Insert Command="Insert Region With History" Insert Command Type="Stored Procedure" Hi, Thanks for your reply. If they are not equal, values cannot be assigned to the update command.

Then, when all the inserting is complete, the user clicks a submit button to insert all the rows from the gridview into a database table. Referencing gridview fields in Row Updating event I have the following code in place.

In the above code, I set two properties Show Edit Button and Show Cancel Button of Command Field.

These properties will automatically render Edit, Update and Cancel buttons inside Grid View column.

This is my current attempt that returns the error ' Object reference not set to an instance of an object'. or if I pick resale only items that can be sold show up. So i post it one more time, becuase it's really urgent. my asp:gridview control and sqldatasource control are pasted: Data Controls insert rows into gridview then insert rows from gridview into SQL Table Hello there, I'm still new at performing miracles with code .

I presume its related to correctly targeting the Drop Down List in question? And i have read a lot from MSDN, and i followed exactly like what it says, but i still can't edit the rows.... Currently I am having trouble with my latest coding adventure I have a web application which records jobs and labour assigned to jobs.

Leave a Reply