表适配器未获取更新声明 [英] the table adapter doesnt get update statment

查看:71
本文介绍了表适配器未获取更新声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据集和一个数据表.

该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 your VIPTableAdapter have a valid UpdateCommand? If not, set it and try.


这篇关于表适配器未获取更新声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆