From abf89999168abc3e5bd60eab68f39aca94634f38 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Wed, 16 Nov 2022 00:03:08 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=20Utils.ReplaceSqlConstS?= =?UTF-8?q?tring=20bug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Examples/base_entity/Program.cs | 8 ++++++-- FreeSql/Internal/UtilsExpressionTree.cs | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Examples/base_entity/Program.cs b/Examples/base_entity/Program.cs index a644f48f..84b9f7da 100644 --- a/Examples/base_entity/Program.cs +++ b/Examples/base_entity/Program.cs @@ -400,6 +400,10 @@ namespace base_entity static void Main(string[] args) { + var pams = new Dictionary(); + var sql2rscs = Utils.ReplaceSqlConstString("'', 'SARTEN ACERO VITR.18CM''''GRAFIT''''', 'a", + pams, "@lantin1"); + using (IFreeSql client = CreateInstance(@"Driver={Microsoft Access Driver (*.mdb)};DBQ=d:/accdb/2007.accdb", DataType.Odbc)) { Dictionary data = new Dictionary(); @@ -409,8 +413,8 @@ namespace base_entity data.Add("PType", "RS"); data.Add("GType", "窨井轮廓线"); data.Add("LineStyle", 2); - data.Add("Memo", null); - data.Add("ClassID", null); + data.Add("Memo", DBNull.Value); + data.Add("ClassID", DBNull.Value); var kdkdksqlxx = client.InsertDict(data).AsTable("FZLINE").ToSql(); } diff --git a/FreeSql/Internal/UtilsExpressionTree.cs b/FreeSql/Internal/UtilsExpressionTree.cs index 1edaf42c..023e8c31 100644 --- a/FreeSql/Internal/UtilsExpressionTree.cs +++ b/FreeSql/Internal/UtilsExpressionTree.cs @@ -2458,6 +2458,7 @@ namespace FreeSql.Internal } if (sidx < sql.Length && sql[sidx] == '\'') { + sidx++; startLength += 2; continue; }