DEV Community

Arunprasath
Arunprasath

Posted on

2

C#

bulk datatable insert in Sqlite database?

Top comments (3)

Collapse
 
thebuzzsaw profile image
Kelly Brown

Using which library?

Collapse
 
csearun profile image
Arunprasath

System.Data.SQLite library

Collapse
 
thebuzzsaw profile image
Kelly Brown

I don't know the specifics of that library. I tend to use SQLite raw (direct native calls). You can batch up an insert this way.

INSERT INTO my_table (col1, col2, col3) VALUES
(?, ?, ?),
(?, ?, ?),
(?, ?, ?),
(?, ?, ?),
(?, ?, ?),
(?, ?, ?)

You have to bind all the parameters and then execute it. Are you referring to a literal C# DataTable?

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay