Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Pragma-s of SQLite in C#

Tags:

c#

sqlite

I had posted a question

"My Projects has c++ dll in which a db is created in Sqllite with share deny = none . This dll will insert data into Db and I have a c# exe which must access the db and display it . Display needs to be done asynchronously. So there any way while launching connection to sqlitedb i can lock the table or db. if Possible can anyone give me links or sample on how it can be done "

for this I got a reply of of using Pragma -s can any one tell me on how to implement PRagma-s of SQLlite in C#.

like image 407
subbu Avatar asked Feb 18 '10 06:02

subbu


People also ask

What does pragma do SQLite?

The PRAGMA statement is an SQL extension specific to SQLite and used to modify the operation of the SQLite library or to query the SQLite library for internal (non-table) data.

What is pragma Integrity_check?

Description. The integrity_check pragma runs a self-check on the database structure. The check runs through a battery of tests that verify the integrity of the database file, its structure, and its contents. Errors are returned as text descriptions in a single-column table.

What does pragma mean SQL?

The PRAGMA keyword is used to signify that the remainder of the PL/SQL statement is a pragma, or directive, to the compiler. Also called apseudoinstruction, a pragma simply passes information to the compiler rather than getting transformed into a particular execution.

What is a pragma statement?

A pragma is a compiler directive that allows you to provide additional information to the compiler. This information can change compilation details that are not otherwise under your control. For example, the pack pragma affects the layout of data within a structure. Compiler pragmas are also called directives.


1 Answers

Pragmas can be set in your connection string

For eg:
String conString = "Data Source=filename;Version=3;PRAGMA locking_mode = NORMAL;"

You can append more than one pragma to the connection string

like image 50
Amsakanna Avatar answered Sep 24 '22 15:09

Amsakanna