Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



Suppose you display a data having 200 records in a datagrid. Then you edit 100 records of them. No..

Answer / guest

Here, bind primary key of database to datagrid column make
it visible false.
and travel loop as

foreach(DataGridItem dataItem in DataGrid1.Items)
{
priceText = (TextBox)dataItem.FindControl
("txtBookPrice");
bookIdText = (TextBox)dataItem.FindControl("txtBookId");

Updatecode_for_perticular_row ();

}

txtBookPrice= textbox from witch u would like to update
txtBookId= test i.e. unique id comming from database

With help of unique id in for loop find perticular text in
texbox and update.

This code you will write on update button click.

Is This Answer Correct ?    3 Yes 0 No

Suppose you display a data having 200 records in a datagrid. Then you edit 100 records of them. No..

Answer / arief

First you load 20 records to DataGrid and add one
more templet field like"Chech Box" finally add one button
in your page for update operation

you write code whatever CheckBox clike get all row
id's and you can update row based on selected id's

Is This Answer Correct ?    3 Yes 0 No

Suppose you display a data having 200 records in a datagrid. Then you edit 100 records of them. No..

Answer / 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

Suppose you display a data having 200 records in a datagrid. Then you edit 100 records of them. No..

Answer / masuduz zaman

By using dataSet.GetChanges(DataRowState.Modified) method we can update all 100 records at a time.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

To display data in a Repeater control which templete is provided ?

4 Answers   Siebel,


What is the application pool?

0 Answers  


What does mean by a neutral culture?

0 Answers   MindCracker,


What is the page life cycle in asp.net?

0 Answers  


What are the types of assemblies and where can u store them and how ?

1 Answers   Patni,


What is JIT, what are types of JITS and their purpose ?

3 Answers   Infosys,


What are the various ways of securing a web site that could prevent from hacking etc ?

1 Answers  


Explain asp.net application life cycle?

0 Answers  


Differences between VB.Net and C#, related to OOPS concepts

5 Answers   CSC,


What is http post action?

0 Answers  


What is a 401 redirect?

0 Answers  


About Postback ?

6 Answers   Accenture,


Categories