Finisar SQLite库为C#未分配的文件格式 [英] Finisar SQLite library for C# Unsuported file format

查看:397
本文介绍了Finisar SQLite库为C#未分配的文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个数据库表(Mail),它有两列:id INTEGER,content INTEGER。在我的应用程序中,我测试了连接,它工作得很好。

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();

之后,我改变了表Mail,它看起来像这样:id INTEGER,content INTEGER ,accountid INTEGER。当我再次尝试连接时,下一个错误显示: UNSUPORTED FILE FORMAT
这意味着我不能修改任何表格?

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?

请让我明白。

谢谢!

推荐答案

尽管可能不需要它,但最好将数据库文件命名为.db扩展名像mydatabase.db)。

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

然而,在这种情况下,似乎通过SQLite(3?2?)。exe命令更改您的表,外部管理员,使您的数据库不可读的Finisar的库。我建议您从 Sourceforge ,因为它与最新的SQLite版本兼容。不要忘记将System.Data.SQLite.dll文件导入到您的项目中,并将您的引用从Finisar.SQLite更改为System.Data.SQLite。

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.

此外,如果您安装ADO.NET 2.0库,您可能希望为Visual Studio 2008添加设计时支持,以便通过服务器浏览器编辑表。

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.

这篇关于Finisar SQLite库为C#未分配的文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆