Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I was recently trying with this problem. I was trying this in asp.net 2.0 and using [Production].[Product] table of AdventureWorks (SQL 2005).

The problem is as follows:

Some particular number of rows in GridView in Default.aspx. The first column is a checkbox field for user to select arbitrary rows. The second and third columns are ProductId and Name from Product table.

There is one Insert button for triggering asynchronous postback and one lable to show message to the user. The user selects some rows by checking the checkboxes in front of rows and clicks Insert button. Now, the selected rows should be inserted in another table with fields Id, ProductId and Name.

Further, suppose, the user selects 6 rows out of 10 displayed inside GridView. While these rows being inserted one by one into another table the message should be displayed to the user as: "Inserting {1} of {6} selected" for each row selected. :doh:

Please someone provide solution to this problem.
Posted
Updated 14-Dec-09 18:14pm
v3

1 solution

You will get better performance if you send all the IDs at once, deleting the rows, and returning a response with any errors.
What takes the most time is the connection and data transmission between the client and the web server and the web server and the database.
By sending all, you reduce it from 6 web server and database calls to one.
 
Share this answer
 

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