Finisar SQLite library for C# Unsuported file format

五迷三道 提交于 2019-12-11 08:37:28

问题


I've created a database an a table ("Mail") having 2 columns: id INTEGER, content INTEGER. In my aplication I have tested the connection and it works well.

using Finisar.SQLite;

...

string db = "mydatabase";
SQLiteConnectionsql_con = new SQLiteConnection("Data Source=" + db + ";Version=3;New=False;Compress=True;");
sql_con.Open();
sql_con.Close();

After this I have alter the table "Mail" and it look like this: id INTEGER, content INTEGER, accountid INTEGER. When I tryed the connection again the next error was show: UNSUPORTED FILE FORMAT. This mean that I can't modify any table?

Please make me understand.

Thanks!


回答1:


While it may not be required, it is a good practise to name your database files with an .db extension (like "mydatabase.db").

However, in this case, it seems that altering your table via the SQLite(3? 2?).exe command, or an external administrator, turns your DB unreadable by Finisar's library. I advise you to download the succesor of the SQLite .Net library from Sourceforge, since it is compatible with the latest SQLite version. Dont forget to import the System.Data.SQLite.dll file into your project and to change your references from Finisar.SQLite to System.Data.SQLite.

Also, if you install the ADO.NET 2.0 libary, you might want to add design time support for Visual Studio 2008 so you van edit tables via the server explorer.



来源:https://stackoverflow.com/questions/1760457/finisar-sqlite-library-for-c-sharp-unsuported-file-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!