Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I need to use Sqllite database with c# in my window application, as it is my first project using sqllite. Added the dll referenec System.Data.sqllite to my project bu i am not able to read the database, i have tried lots of sample code from Google but it didn't work.

Any body can provide the steps for reading and the data from sqllite database would be a great help to me.

Thanking you in advance.
Posted
Comments
OriginalGriff 11-Oct-12 5:41am    
What did you try?
Member 4531085 15-Oct-12 6:43am    
I tried to create a small testing application in C# using database as sqllite having dll System.Data.Sqllite version 1.0.82 and its running perfectly on my 64 bit machine. Now i tried to use the same sqlLite database in my main application it continuously giving me error message, Both application is on same machine

code that i written
Collapse | Copy Code
SQLiteConnection objConn = null;
SQLiteDataAdapter oleda = new SQLiteDataAdapter();
SQLiteCommand cmd = new SQLiteCommand();
Collapse | Copy Code
string filename = DefaultLogFilePath + "\\AppData\\LocalLow\\Dictionary\\Dictionary.sqlite";
const string sql = "select * from DictionaryFile;";
objConn = new SQLiteConnection("Data Source=" + filename + ";Version=3;");
objConn.Open();
oleda = new SQLiteDataAdapter(sql, objConn);

oleda.Fill(dt);



Collapse | Copy Code
Could not load file or assembly 'System.Data.SQLite, Version=1.0.82.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.
OriginalGriff 15-Oct-12 7:30am    
Check your references - you are trying to use a file it can't find!
Zoltán Zörgő 11-Oct-12 5:45am    
Post your code and your error messages here!

1 solution

We have an article about, here at COdeProject: "Using SQLite in your C# Application"[^].
 
Share this answer
 

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