Click here to Skip to main content
15,887,849 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
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

code that i written
SQLiteConnection objConn = null;
           SQLiteDataAdapter oleda = new SQLiteDataAdapter();
           SQLiteCommand cmd = new SQLiteCommand();

C#
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);




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.


Can anybody suggest me how to solve this issue.





Thanks
Anand
Posted

1 solution

I encountered the same issue. It is because the sqlite assamblies are compiled for specific platforms, not anycpu. Tus you have to use the proper dll for that platform. If you have not set strong name verification for that dependency, simply replace the dll[^]. You can check the dependency problems with a dependency walker like this: Depends4Net - Part 1[^].
 
Share this answer
 
Comments
Member 4531085 15-Oct-12 6:44am    
I tried the Depend4Net but it is not prompting any missing assembly for my code
Zoltán Zörgő 15-Oct-12 7:05am    
It won't report as missing it will report wrong platform. But heer is an other one, with more comprehensive interface: http://www.dependencywalker.com/

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