dotnet / dotnet/docs

Command object needs the transaction to be assigned

Open
#37,580 0 comments 0 reactions 0 assignees View on GitHub
:watch: Not Triaged dotnet-data/svc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
19h 10m
Merged PRs (30d)
268

Description

### Type of issue

Code doesn't work

### Description

If the connection has a pending transaction, the ExecuteNonQuery method will fail if the command object's Transaction property is not set to that transaction.

Add

> command.Transaction = transaction;

after instantiating the command object

### Page URL

https://learn.microsoft.com/en-us/dotnet/standard/data/sqlite/bulk-insert

### Content source URL

https://github.com/dotnet/docs/blob/main/docs/standard/data/sqlite/bulk-insert.md

### Document Version Independent Id

ddb917b7-e6d4-c4d6-dab4-9a0eadd2aed9

### Article author

bricelam

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.