SQLite连接无法在C#中工作

Dar*_*vil 4 c# database sqlite connection-string

我正在使用操作SQLite数据库的C#应用​​程序,直到昨天它工作正常,它正在检索记录,

但自昨晚以来,Connection String返回Data Source = null

以下是测试代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;

namespace SQLiteTest
{
    public partial class Form1 : Form
    {
        //string connection_string = "Data Source=UrduDictionary";
        string connection_string = "Data Source=" + Environment.CurrentDirectory + "\\Test.sqlite";
        string query = "";
        private SQLiteConnection _connection;
        private SQLiteCommand _command;
        private SQLiteDataAdapter _adapter;
        DataSet local;
        public Form1()
        {
            InitializeComponent();
        }
    void Make_Connection()
    {
        _connection = new SQLiteConnection(connection_string);
    }
    private void button1_Click(object sender, EventArgs e)
    {                 
         Make_Connection();
    }

}
Run Code Online (Sandbox Code Playgroud)

}

下面是在Watch Window中调试期间看到的图像.

我使用的库是 "SQLite-1.0.66.0-setup.exe"

我已经测试了其他数据库创建但相同的结果,任何机构可以帮忙吗?

Dar*_*vil 6

这是我做的:

private void button2_Click(object sender, EventArgs e)
{
    string dbPath = Path.Combine(Environment.CurrentDirectory, "UrduDictionary");
    string connString = string.Format("Data Source={0}", dbPath);

    using (SQLiteConnection conn = new SQLiteConnection(connString))
    {
        StringBuilder query = new StringBuilder();
        query.Append("SELECT * ");
        query.Append("FROM CATIGORY_TABLE ");

        using (SQLiteCommand cmd = new SQLiteCommand(query.ToString(), conn))
        {
            conn.Open();

            using (SQLiteDataReader dr = cmd.ExecuteReader())
            {
                while (dr.Read())
                {
                    Console.WriteLine("{0} {1} {2}",
                        dr.GetValue(0),
                        dr.GetValue(1),
                        dr.GetValue(2));
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)