A
andy6
I am using the following code and SQL Profiler shows no activity when I step
through the .update line. Do you see a syntax error?
Thanks!
using (SqlConnection cn = new SqlConnection(cnStr))
{
SqlCommand updCmd = new SqlCommand
("sp_web_edit_manager_update", cn);
SqlDataAdapter adpt = new SqlDataAdapter(updCmd);
updCmd.UpdatedRowSource = UpdateRowSource.None;
updCmd.Parameters.Add("@entity", SqlDbType.VarChar,10,
dtOnlyChanges.Columns[0].ColumnName);
updCmd.Parameters.Add("@edit_id", SqlDbType.Int, 4,
dtOnlyChanges.Columns[1].ColumnName);
updCmd.Parameters.Add("@edit_override", SqlDbType.VarChar, 1,
dtOnlyChanges.Columns[2].ToString());
updCmd.Parameters.Add("@biller_cd", SqlDbType.VarChar, 20,
dtOnlyChanges.Columns[3].ToString());
updCmd.Parameters.Add("@include_in_stats", SqlDbType.VarChar,
1, dtOnlyChanges.Columns[4].ToString());
adpt.UpdateCommand = updCmd;
// Set the Batch Size. 0 means all; default is 1.
adpt.UpdateBatchSize = 10;
// Send the new rows and the changed rows to the database
adpt.Update(dtOnlyChanges);
}
through the .update line. Do you see a syntax error?
Thanks!
using (SqlConnection cn = new SqlConnection(cnStr))
{
SqlCommand updCmd = new SqlCommand
("sp_web_edit_manager_update", cn);
SqlDataAdapter adpt = new SqlDataAdapter(updCmd);
updCmd.UpdatedRowSource = UpdateRowSource.None;
updCmd.Parameters.Add("@entity", SqlDbType.VarChar,10,
dtOnlyChanges.Columns[0].ColumnName);
updCmd.Parameters.Add("@edit_id", SqlDbType.Int, 4,
dtOnlyChanges.Columns[1].ColumnName);
updCmd.Parameters.Add("@edit_override", SqlDbType.VarChar, 1,
dtOnlyChanges.Columns[2].ToString());
updCmd.Parameters.Add("@biller_cd", SqlDbType.VarChar, 20,
dtOnlyChanges.Columns[3].ToString());
updCmd.Parameters.Add("@include_in_stats", SqlDbType.VarChar,
1, dtOnlyChanges.Columns[4].ToString());
adpt.UpdateCommand = updCmd;
// Set the Batch Size. 0 means all; default is 1.
adpt.UpdateBatchSize = 10;
// Send the new rows and the changed rows to the database
adpt.Update(dtOnlyChanges);
}