diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs index d0d7ea75d..a5ceaddbb 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs @@ -168,7 +168,7 @@ namespace SqlSugar } else if (type == UtilConstants.ByteArrayType) { - string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value); + string bytesString = "0x" + BitConverter.ToString((byte[])value); return "N'" + bytesString + "'"; } else if (type.IsEnum()) diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs index a0913d81e..592969f2e 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs @@ -261,7 +261,7 @@ namespace SqlSugar } else if (type == UtilConstants.ByteArrayType) { - string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value); + string bytesString = "0x" + BitConverter.ToString((byte[])value); return "N'" + bytesString + "'"; } else if (type.IsEnum()) diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs index 2f4ec21db..9c28a442c 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleInsertBuilder.cs @@ -111,7 +111,7 @@ namespace SqlSugar } else if (type == UtilConstants.ByteArrayType) { - string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value); + string bytesString = "0x" + BitConverter.ToString((byte[])value); return "N'" + bytesString + "'"; } else if (type == UtilConstants.BoolType) diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleUpdateBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleUpdateBuilder.cs index 4a9c16834..e9cc79b38 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleUpdateBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleUpdateBuilder.cs @@ -60,7 +60,7 @@ namespace SqlSugar } else if (type == UtilConstants.ByteArrayType) { - string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value); + string bytesString = "0x" + BitConverter.ToString((byte[])value); return "N'" + bytesString + "'"; } else if (type == UtilConstants.BoolType)