没有给出一个或多个必需参数 [英] No given for one or more required parameter

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

问题描述

大家好。

我想删除ACCESS 2010和C#.net中INNER JOIN关系的特殊表记录。但我有以下错误:



没有给出一个或多个必需参数



Hi all.
I wanna delete the special table record with INNER JOIN relationship in ACCESS 2010 and C#.net. but I have following error :

No given for one or more required parameter

DELETE DISTINCTROW  Ghesting.*
 FROM  ((kala INNER JOIN buyer ON kala.buyer_codem = buyer.code_m_buyer) INNER JOIN Ghesting ON buyer.code_m_buyer = Ghesting.fk_code_m_buyer) 
WHERE ([buyer.code_m_buyer] =[?]) AND (kala.serial_kala=?)

推荐答案

这里你真的不需要JOIN,因为你只想删除具有特定值的行:

You don't really need the JOINs here, as you just want to delete the rows with specific value:
DELETE FROM Ghesting WHERE fk_code_m_buyer = ?



但你需要提供参数:这是陈述的问题,你没有提供所需的参数。



也许:


But you need to supply the parameter: this is the problem that is stated, you did not provide the required parameter.

Maybe:

yourCommandObject.Parameters.AddWithValue("fk_code_m_buyer", yourValue);



应该这样做。



解决方案正确的例子[/编辑]




should do it.

Solution with the correct example [/EDIT]

DELETE FROM Ghesting INNER JOIN buyer ON buyer.code_m_buyer = Ghesting.fk_code_m_buyer INNER JOIN kala ON kala.buyer_codem = buyer.code_m_buyer WHERE fk_code_mbuyer = ? AND kala.serial_kala = ?





您仍需提供这两个参数但是在执行查询时。



作为一般建议,你真的应该规范你的列命名方式,这会使你的查询更简单,更易读并且不太容易发生拼写错误。

第二,当你发帖提问时,请注意第一次提供所有相关和确切的细节;它会阻止我们浪费时间:)



亲切。



You still have to provide both parameters when executing the query, though.

As a general advise, you really should normalize the way you are naming your columns, that would make your queries less complicated, more readable, and less prone to typos.
And, second one, when you post a question, please be carefull to give all the relevant and exact details the first time; it will prevent us from wasting our time :)

Kindly.


这篇关于没有给出一个或多个必需参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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