private IDbCommand BuildUpdateCommand(DataTableMapping mappings, DataRow dataRow)
{
IDbCommand command1 = this.InitializeCommand(this.UpdateCommand);
StringBuilder builder1 = this.GetStringBuilder();
int num1 = 0;
string text1 = " SET ";
builder1.Append("UPDATE ");
builder1.Append(this.QuotedBaseTableName);
int num2 = this._dbSchemaRows.Length;
for (int num3 = 0; num3 < num2; num3++)
{
DBSchemaRow row1 = this._dbSchemaRows[num3];
if (((row1 != null) && (row1.BaseColumnName.Length != 0)) && this.IncludeInUpdateSet(row1))
{
object obj1 = null;
string text2 = this._sourceColumnNames[num3];
if ((mappings != null) && (dataRow != null))
{
DataColumn column1 = this.GetDataColumn(text2, mappings, dataRow);
if ((column1 == null) || (row1.IsReadOnly && column1.ReadOnly))
{
goto Label_013D;
}
obj1 = this.GetColumnValue(dataRow, column1, DataRowVersion.Current);
if (this.IsNotBehavior(CommandBuilderBehavior.UpdateSetSameValue))
{
object obj2 = this.GetColumnValue(dataRow, column1, DataRowVersion.Original);
if ((obj2 == obj1) || ((obj2 != null) && obj2.Equals(obj1)))
{
goto Label_013D;
}
}
}
builder1.Append(text1);
text1 = ", ";
builder1.Append(this.QuotedColumn(row1.BaseColumnName));
builder1.Append(" = ");
builder1.Append(this.CreateParameterForValue(command1, text2, DataRowVersion.Current, num1, obj1, row1));
num1++;
}
Label_013D:;
}
bool flag1 = 0 == num1;
num1 = this.BuildWhereClause(mappings, dataRow, builder1, command1, num1, true);
command1.CommandText = builder1.ToString();
OracleCommandBuilder.RemoveExtraParameters(command1, num1);
this.UpdateCommand = command1;
if (!flag1)
{
return command1;
}
return null;
}
相关文章:
-
2022-02-19
-
2021-11-25
-
2021-11-02
-
2021-06-08
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-12-23
猜你喜欢
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-01-11
-
2021-05-04
-
2022-01-16
相关资源
-
下载
2021-06-05
-
下载
2021-07-14
-
下载
2023-02-14