Hi
I have a SQLCommand that do updates on a table.
I have a loop where I set the parameters then I call ExecuteNonQuery.
For .
{
. Set the SQLCommand's Params Values;
. SQLCommand.ExecuteNonQuery();
}
Is it possible to "cache" the SQL text sent by Calling ExecuteNonQuery() and
then execute the whole "cached SQL text" in one command ?
Something Like that :
StringBuilder Sb = new StringBuilder();
For.
{
. Set the SQLCommand's Params Values;
. Sb.Append(SQLCommand.GetExecuteNonQueryCmd() + " \n\n");
// GetExecuteNonQueryCmd() don't exists. It's to illustrate the
principle I'm looking for.
}
SqlCommand Sc = New SqlCommand();
Sc.CommandText = Sb.Totring();
Sc.Executenonquery();
Thanks for your help !
Steph.