because the CommandBuilder is smart ;-) It actually uses the SelectCommand to generate the Command appropriately.
Only thing I can suggest is from your example, perhaps do this but it may not work all the time.
dataAdapter.UpdateCommand = new OleDbCommand("UPDATE tMyTable SET ", connection);
foreach (DataColumn column in m_tMyTable.Columns) { if( column.ColumnName == "Nr" ) continue; dataAdapter.UpdateCommand.CommandText += column.ColumnName + "= ";
if (column != m_tListenListe.Columns[m_tListenListe.Columns.Count - 1]) dataAdapter.InsertCommand.CommandText += ", "; } }
dataAdapter.UpdateCommand.CommandText += ") WHERE Nr= ";
this will add the value of the row you specify of the current column to the parameter collection, so hopefully this may be ok to use. What happens
|