表适配器未获取更新声明 [英] the table adapter doesnt get update statment
问题描述
我有一个数据集和一个数据表.
该DataTable使用数据库中2个表的字段.它们都不是主键.
现在在Windows窗体中,我使用了DataGrid和一个按钮.
按下按钮时,我使用以下代码更新了DataTable:
VIPTableAdapter.Update(myDataSet.VIP)
它显示此错误:
``更新''不是``myApplication.myDataSetTableAdapter.VIPTableAdapter''的成员
我无法向DataTable添加更新方法,为什么?
非常感谢.
I have a DataSet and a DataTable in it.
This DataTable uses the fields of 2 table in the database. None of them are primary key.
Now in the windows form, I used a DataGrid and a button.
I used this code to update the DataTable when I press the button:
VIPTableAdapter.Update(myDataSet.VIP)
It shows this error:
''update'' is not a member of ''myApplication.myDataSetTableAdapter.VIPTableAdapter''
I cant add update method to the DataTable, why?
Thanks alot.
推荐答案
您的VIPTableAdapter
是否有有效的UpdateCommand
?如果没有,请设置并尝试.
Does yourVIPTableAdapter
have a validUpdateCommand
? If not, set it and try.
这篇关于表适配器未获取更新声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!