Newer
Older
RbFreqStand / RbFreqStandMeasure / db / SqliteHelper.cs
TAN YUE on 13 Mar 2021 967 bytes 添加项目文件。
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Casic.Birmm.RbFreqStandMeasure.Db
{
    public class SqliteHelper
    {
        static readonly string DB_PATH = "Data Source="+Application.StartupPath+ "\\sqlite\\data\\rb_freq_comp.db";
        public static SQLiteConnection sqliteConnection = null;
        public static int OpenDB()
        {
            int iRetval = -1;
            try
            {
                sqliteConnection = new SQLiteConnection(DB_PATH);
                sqliteConnection.Open();
                iRetval = 0;
            }
            catch (SqlException exSql)
            {
                iRetval = exSql.ErrorCode;
            }
            catch (SQLiteException sqliteEx)
            {
                iRetval = sqliteEx.ErrorCode;
            }

            return iRetval;
        }


    }
}