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#.
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With