找不到对象数据源方法insert,update,delete [英] object data source could not found method insert , update , delete

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

问题描述

你好,
我是一个ASP .NET编码器.我正在使用c#进行项目,在后端有my-sql.我已经从解决方案资源管理器创建了数据集.我已经为客户创建正确配置了表适配器.在这里方法get可以正常工作.比我有关于插入,更新,删除添加查询.首先,我在asp .net Web表单中从工具箱添加了一个objectdatasource.使用datatabletableadapters.customerstableAdapter配置它.选择get方法作为select方法并提供我在数据表adpater中创建的插入,更新,删除方法.比起我拖动详细信息视图并选择数据源作为objectDataSource1而言.启用insert,update,
删除 .现在每件事都可以正常进行.当我运行该网页时,detailsView会显示客户的信息.但是当我进行编辑,更新,删除时,它显示了一个错误,即对象数据源找不到查询delete及其参数.

Hello ,
I am a asp .net coder . I am doing my project using c# and at the back end there is my-sql . I have created dataset from solution explorer . I have configured table adapter correctly for Customer creation . here the method get works correctly . than i have add query regarding insert , update , delete . At the asp .net web form first i have added a objectdatasource from the toolbox . configured it with datasettableadapters.customerstableAdapter . select the get method as select method and provide insert , update , delete method what i have created at the dataset table adpater . Than i have drag a details view and select the datasource as objectDataSource1 . enable insert , update ,
delete . Every thing works fine now on word . When I run the webpage the detailsView show the information of the customers . But when i go for edit , update , delete than it shows an error that object datasource could not find query delete and it''s parameter . What may be the solution .

推荐答案

此错误意味着即使您正确编写了代码,也没有使用查询分析器或SQL在sql中创建存储过程.在sql中创建表时的Sql管理工作室.

在代码中也使用存储过程字符串,那么它将起作用,根据我的说法,您正在使用参数在代码中的数据库中传递查询值,就像您在代码的插入查询中使用存储过程值一样,但是没有在sql中创建存储过程,它给出了找不到参数的错误.我希望存储过程对您有用,当然可以.

prasad :-D
this error means that even though you have writen the code correct, you have not created the stored proceduer in sql by using query analiser or management studio of Sql as you created the table in sql.

use the stored procedure string in code also, then it will work, according to me you are using parameters to pass query values in the database in your code as you might be using stored procedure value in insert query of your code, but as you have not created a stored procedure in sql it is giving an error of parameters not found.I hope stored procedures work for you, yes ofcourse it will.

prasad :-D


事情是我正在使用查询而不是过程.
thing is that i am using query instead procedure .


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

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