StackTrace
StackTrace

Reputation: 9416

how to insert multiple rows intered in DataGridview into database table at once

I have an Unbound DataGridview that supports adding new records. The user can enter one or more records into this DataGridview and at this time, nothing should be saved.

When a user is done with entering records, I want to them to click a button and have all the rows in the DataGridview inserted into a table.

I am using Linq To Entities.

Upvotes: 2

Views: 1648

Answers (1)

Jayantha Lal Sirisena
Jayantha Lal Sirisena

Reputation: 21366

Bulk insert is not supported by EF directly. You can use SqlBulkCopy Class (System.Data.SqlClient). Here is a good article.

Upvotes: 2

Related Questions