Suppose you display a data having 200 records in a
datagrid. Then you edit 100 records of them. Now when you
will press update button,all 100 records should be updated
in single shot rather than reading every record and
updating. How to do it?
Answer Posted / pradeep
Each row is having Edit/Update/Cancel button.
In "_UpdateCommand" event, we can write a code to update
directly into the database. But it is not good practice.
For updating whole records in a single event, we need to
have hidden column for updateflag and while updating we can
store the updated data into session. By using BUTTON
control out side of datagrid, we can find only 100 records
(updated records) based on updateflag and we can update
only those records into DB.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Difference between DataGid and Girdview? Difference b/w .Net 2.0, 3.0 and 3.5 ? Diff b/w dispose & Finialize Methods?
Which method do you use to enforce garbage collection in .net?
Explain the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
What is sql data source control in asp.net?
What is css and what is it used for?
How can you handle unmanaged code exceptions in asp.net?
Differentiate between a hyperlink control and a linkbutton control.
What is the recommended approach for asp.net mvc to globally intercept exceptions? What other functionality can be implemented with the approach? : Asp.Net MVC
In a Repeater control how one can provide an alternating color scheme ?
What is session id in web application?
What is server components?
Explain why it is useful to use mvc instead of webforms? : asp.net mvc
How can we update records in gridview?Is there any appropriate code for it?
What are the asp.net security controls?
What is state management in asp.net with example?