0

I'm using checkbox to select the rows in the gridview. How do I insert the muliple selected rows into the table opening the connection for only one time.

1
  • 1
    Why not use a for / foreach? You could use LINQ's "Where" clause, but it does a for loop in the background as well. Commented Dec 9, 2010 at 7:53

2 Answers 2

3

When you postback, read all the checked rows and put the data into a DataTable. You can then use a SqlBulkCopy object to push that DataTable into your database table.

Sign up to request clarification or add additional context in comments.

Comments

0

Using JS to write into hidden field when user (un)checks a checkbox or to perform ajax call to server with id checked row.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.