Click here to Skip to main content
15,886,720 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

I'm new for sqlite. I've find that sqlite be good for database for windows application for deployed

When I'm trying to connect sqlite database with the name abc.db And With the following code :-

C#
SQLiteConnection sqlite_conn;
SQLiteCommand sqlite_cmd;

// create a new database connection:
sqlite_conn = new SQLiteConnection("Data Source=abc.db;Version=3;New=False;Compress=True;");

// open the connection:
sqlite_conn.Open();

// create a new SQL command:
sqlite_cmd = sqlite_conn.CreateCommand();

// Lets insert something into our new table:
sqlite_cmd.CommandText = "INSERT INTO Company (Name) VALUES ('Test Text 1');";

// And execute this again ;D
sqlite_cmd.ExecuteNonQuery();

// We are ready, now lets cleanup and close our connection:
sqlite_conn.Close();

then it show the error :- Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

On the line sqlite_conn.Open();

How to get rid to it.

Thanks In Advance
Posted
Updated 13-Mar-15 6:35am
v4
Comments
Sergey Alexandrovich Kryukov 13-Mar-15 11:48am    
Not enough information. Well, try not to corrupt your memory. Not informative advice? It is at least no less informative than your question. :-)
—SA
binadi007 13-Mar-15 12:19pm    
Please Check Now I've modified my code
Sergey Alexandrovich Kryukov 13-Mar-15 14:39pm    
Hm...
MarbryH 13-Mar-15 15:23pm    
Are there 32 and 64 bit versions of SQLLite?

You might try setting the application build platform target option to x86 and see if it goes away.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900