Net Core教程

C# 访问加密sqllite

本文主要是介绍C# 访问加密sqllite,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.我使用的版本System.Data.SQLite   版本 1.0.58.0  x64    .net framework 3.5 

 

2.引用System.Data.SQLite

 

 

 

 

3.代码测试

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
using System.Linq;
using System.Text;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "Data Source=G:/xxxx.db;Initial Catalog=sqlite;Integrated Security=True;Max Pool Size=10;Password=xxxx";
            SQLiteConnection sqlLiteConnection = new SQLiteConnection(connectionString);
            if (sqlLiteConnection.State != System.Data.ConnectionState.Open)
            {
                sqlLiteConnection.Open();
                string sql = "SELECT * FROM sqlite_master WHERE type='table' ";
                var cmd = new SQLiteCommand(sql, sqlLiteConnection);
                cmd.CommandText = sql;
                StringBuilder tableNames = new StringBuilder();
                using (SQLiteDataAdapter ap = new SQLiteDataAdapter(sql, sqlLiteConnection))
                {
                    DataSet ds = new DataSet();
                    ap.Fill(ds);
                    DataTable dt = ds.Tables[0];
                }
            }
            sqlLiteConnection.Close();
        }
    }
}

4.System.Data.SQLite版本

下载地址 https://master.dl.sourceforge.net/project/sqlite-dotnet2/OldFiles/SQLite-1.0.58.0-binaries.zip?viasf=1

 

这篇关于C# 访问加密sqllite的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!