数据源 [英] DATA SOURCE

查看:93
本文介绍了数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一个表(由数据源配置向导"添加的表)拖放到
如您所知,Visual Studio会创建TableAdapter,DataSet,..并自动添加一些代码.
但是当我删除一行并要保存时会出现错误:
<<更新要求=" a ="有效=" deletecommand ="当="传递=" datarow =" collection ="与="删除="行.=" >>


I drag and drop a Table (which I added by "Data Source Configuration Wizard" ) on the
form .as you know visual studio create TableAdapter,DataSet ,..and adds some code automatically .
but when I delete a row and want to save it gives error :
<<update requires="" a="" valid="" deletecommand="" when="" passed="" datarow="" collection="" with="" deleted="" rows.="">>


private void nameBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.nameBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.dtDataSet);//Error occurs here 

        }

推荐答案

很明显,您没有提供删除命令.向导将帮助您入门,但仍然需要做一些事情.
It''s quite obvious, you haven''t supplied a delete command. The wizards will get you started but there are still some things you must do.


好,那我该怎么办?!!!!!:confused:
well , what should I do then ?!!!!!:confused:


1-除非您有发布答案,否则不要按下"answer" 2-提供删除命令
2a如果需要,请阅读文档
2b如果您想编写体面的代码,请不要使用此驱动程序,请编写适当的数据层
1 - don''t push ''answer'' unless you have an answer to post
2 - supply a delete command
2a read the documentation if you need to
2b if you want to write decent code, don''t use this drivel, write a proper data layer


这篇关于数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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