如何从gridview外的下拉列表中绑定gridview数据.. [英] how to bind gridview data from dropdownlist outside the gridview ..

查看:103
本文介绍了如何从gridview外的下拉列表中绑定gridview数据..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

strCommand.Parameters.AddWithValue("_Tenant_Id", Convert.ToInt32(ddlTenant.SelectedValue));
                strCommand.Parameters.AddWithValue("_Branch_Id", Convert.ToInt32(ddlBranch.SelectedValue));





如果我写这个..但是异常

参数''_DiseaseId''未在集合中找到。



if i write this ..have exception
Parameter ''_DiseaseId'' not found in the collection.

推荐答案

您好,您的给定代码没有任何错误。可能是另一个问题的例外。请检查您的程序的参数名称并匹配您在代码中添加的内容。



谢谢。
Hello, your given code has not any error. may be the exception is coming from another issue. Please, check your parameter name of your procedure and match which you added in code.

Thanks.


使用调试器查找问题来自哪里。你的代码看起来很好。

和参数名''_DiseaseId''在存储过程中定义,然后你必须从c#传递它的值。请确保在存储过程和c#中都有匹配的参数名称和相同数量的参数。



希望此提示有帮助。
Use debugger to find from where the issue is coming. Your code looks fine.
and the parameter name ''_DiseaseId'' is defined in the stored procedure then you have to pass the value for it from c#. Please make sure you have matched parameter names and equal number of parameter both in Stored proc as well as in c#.

Hope this hint helps.


这篇关于如何从gridview外的下拉列表中绑定gridview数据..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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