ID不正确使用的TableAdapter插入后返回 [英] Incorrect ID is returned after insert using TableAdapter
本文介绍了ID不正确使用的TableAdapter插入后返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我与 <$执行插入C $ C>的TableAdapter :
int pid = this.purchaseTableAdapter.Insert(supplierid, datetime, "",
totalprice, amountpaid);
它返回不正确的ID 1
,而它应返回15。
如何得到正确的ID?
推荐答案
执行模式属性设置为标 那么你得到的ID ,否则行影响。您可以设置没有查询向导查询的财产属性窗口。
set the execute mode property to Scalar, then you get the ID, otherwise the rows-affected. You set the property properties window of the query not in the Query wizard.
(图28)
这篇关于ID不正确使用的TableAdapter插入后返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文