本文介绍了SqlDataAdapter更新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SqlDataAdapter dataAdpater;
SqlCommandBuilder commandBuilder;
this.QCDataAdapterDictionary.TryGetValue(table.TableName, out dataAdpater);
this.QCCommandBuilderDictionary.TryGetValue(table.TableName, out commandBuilder);
if (dataAdpater != null && dataAdpater != null)
{
dataAdpater.InsertCommand = commandBuilder.GetInsertCommand();
dataAdpater.Update(table);
table.AcceptChanges();
}
表是从DB加载的,它已经插入并删除了一些记录,
当我执行上面的程序时,它会执行delete命令,但dataAdpater.DeleteCommand设置为null。非常混淆......
谢谢〜
The Table is load from DB, it have alreadly insert and delete some record,
when i execute above program, it will execute delete command, but the dataAdpater.DeleteCommand set null. very confuse...
thanks~
推荐答案
这篇关于SqlDataAdapter更新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!