wenxiangchao
2026-11-02 fe2aa4880d5c9fd88088ad0ed81ebaca05629f5f
HMI.Core/Util/SqliteHelper.cs
@@ -1,15 +1,13 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.Odbc;
using System.Data.SQLite;
namespace HMI.Core.Util
{
    public class SqliteHelper
    public class SqliteHelper:IDisposable
    {
        private string DataBaseFile = string.Empty;
        public string DataBaseFile { get; private set; } = string.Empty;
        private string ConnectString = string.Empty;
@@ -20,7 +18,7 @@
        public SqliteHelper(string DBFile)
        {
            DataBaseFile = DBFile;
            ConnectString = "DataSource=" + DataBaseFile + ";Version=3;Pooling=False;Max Pool Size=100";
            ConnectString = "DataSource=" + DataBaseFile + ";Version=3;Pooling=False;Max Pool Size=100;";
            conn = new SQLiteConnection(ConnectString);
            cmd = new SQLiteCommand(conn);
        }
@@ -188,7 +186,7 @@
            }
            catch (Exception ex)
            {
                throw new Exception("获取字段名称失败:" + ex.Message);
                throw new Exception("获取表字段名称失败:" + ex.Message);
            }
        }
@@ -210,7 +208,7 @@
            }
            catch (Exception ex)
            {
                throw new Exception("获取字段名称失败:" + ex.Message);
                throw new Exception("获取表名失败:" + ex.Message);
            }
        }
@@ -231,5 +229,10 @@
                conn.Close();
            }
        }
        public void Dispose()
        {
            this.Close();
        }
    }
}