不支持.NETCore2.2中的AlwaysEncrypted”
创始人
2025-01-11 18:30:06
0

在.NET Core 2.2中,不支持Always Encrypted。如果需要使用Always Encrypted功能,可以考虑将应用程序升级到.NET Core 3.0或更高版本。

示例代码:

using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace AlwaysEncryptedDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=MyDatabase;Integrated Security=True;Column Encryption Setting=Enabled;";

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();

                using (SqlCommand command = new SqlCommand("SELECT * FROM Customers", connection))
                {
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            string customerId = reader["CustomerId"].ToString();
                            string firstName = reader["FirstName"].ToString();
                            string lastName = reader["LastName"].ToString();

                            Console.WriteLine($"CustomerId: {customerId}, FirstName: {firstName}, LastName: {lastName}");
                        }
                    }
                }
            }
        }
    }
}

相关内容

热门资讯

透视好友房!wpk透视脚本,德... 透视好友房!wpk透视脚本,德州透视是真的假的,可靠教程(确实是真的有挂);亲真的是有正版授权,小编...
透视中牌率!wpk辅助器下载,... 透视中牌率!wpk辅助器下载,wepokerplus作弊,我来教教你(总是有挂);原来确实真的有挂(...
透视美元局!智星菠萝可以辅助吗... 透视美元局!智星菠萝可以辅助吗,wepoker怎么破解游戏,新版2025教程(真是真的是有挂),亲,...
透视透视!hhpoker辅助软... 透视透视!hhpoker辅助软件下载,hhpoker外挂靠谱吗,攻略教程(原先是有挂);亲,其实确实...
透视好友房!wepoker底牌... 【福星临门,好运相随】;透视好友房!wepoker底牌透视脚本,wpk私人局辅助是真的吗,高科技教程...
透视透视挂!德普之星透视辅助,... 透视透视挂!德普之星透视辅助,hhpoker有没有作弊辅助,透明挂教程(最初有挂);亲真的是有正版授...
透视工具!wepoker透视,... 透视工具!wepoker透视,aapoker透视脚本,切实教程(总是是真的有挂);玩家必备必赢加哟《...
透视教程!wepoker辅助下... 透视教程!wepoker辅助下载,aapoker透视插件,解说技巧(素来有挂)关于aapoker透视...
透视有挂!红龙poker透视,... 透视有挂!红龙poker透视,wepoker怎么看牌型,曝光教程(一贯有挂);红龙poker透视最新...
透视实锤!hhpoker辅助软... 透视实锤!hhpoker辅助软件下载,we-poker有人玩吗,必赢方法(其实存在有挂);大神普及一...