Преглед на файлове

修复后台数据因表问题导致的异常

jianfeng1.wang преди 2 години
родител
ревизия
d784123665
променени са 2 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 1 1
      FactoryTool_CShare/Program.cs
  2. 1 0
      FactoryTool_CShare/Views/Main.cs

+ 1 - 1
FactoryTool_CShare/Program.cs

@@ -34,7 +34,7 @@ namespace MOKA_Factory_Tools
             {
                 if (SQLiteHelper.NewDbFile(reportFolder + "\\ReportData.db"))
                 {
-                    SQLiteHelper.NewTable(reportFolder + "\\ReportData.db", "ReportData", "(id text,url text,content text)");
+                    SQLiteHelper.NewTable(reportFolder + "\\ReportData.db", "ReportData", "(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,url text,content text)");
                 }
             }
             #endregion

+ 1 - 0
FactoryTool_CShare/Views/Main.cs

@@ -1469,6 +1469,7 @@ namespace MOKA_Factory_Tools
                             SQLiteCommand cmd = new SQLiteCommand();
                             cmd.Connection = ReportDB;
                             cmd.CommandText = string.Format("delete from ReportData where id = {0}", id);
+                            cmd.ExecuteNonQuery();
                             cmd.Dispose();
                         }
                     }