mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
-
This commit is contained in:
@@ -77,23 +77,17 @@ namespace SqlSugar
|
||||
using (var cmd = cn.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = this.Context.Insertable(dictionary.First()).AS(dt.TableName).ToSql().Key.Replace(";SELECT LAST_INSERT_ROWID();", "");
|
||||
var isCorrectErrorSqlParameterName = this.Context?.CurrentConnectionConfig?.MoreSettings?.IsCorrectErrorSqlParameterName == true;
|
||||
foreach (DataRow dataRow in dt.Rows)
|
||||
{
|
||||
int correctParameterIndex = 0;
|
||||
{
|
||||
foreach (DataColumn item in dt.Columns)
|
||||
{
|
||||
if (isCorrectErrorSqlParameterName)
|
||||
if (IsBoolTrue(dataRow, item))
|
||||
{
|
||||
if (!cmd.CommandText.Contains("@" + item.ColumnName))
|
||||
{
|
||||
cmd.Parameters.AddWithValue($"@CrorrPara{correctParameterIndex}", dataRow[item.ColumnName]);
|
||||
correctParameterIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@" + item.ColumnName, dataRow[item.ColumnName]);
|
||||
}
|
||||
cmd.Parameters.AddWithValue("@" + item.ColumnName, true);
|
||||
}
|
||||
else if (IsBoolFalse(dataRow, item))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@" + item.ColumnName, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user