本文介绍了错误“没有给出所需参数的值”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行以下代码时出现错误没有给出一个或多个必需参数的值错误。我无法找出问题所在。请帮帮我。谢谢。





I got error "No value given for one or more required parameters" error when executing the following code. i can't find out where is problem. Please help me out. Thanks.


using (OleDbConnection con = new OleDbConnection(ConfigurationManager.AppSettings["connection"]))
               {
                   con.Open();
                   OleDbCommand cmd = new OleDbCommand("Select * from Loan where Plan_Id IS NOT NULL AND MStaus IS NULL ", con);

                   OleDbDataReader dr = cmd.ExecuteReader();
                   while (dr.Read())
                   {
                       plid++;
                       if (dr["PayStatus"].ToString() == "Paid")
                       {
                           mstat++;
                       }
                   }
               }

推荐答案

OleDbCommand cmd = new OleDbCommand("Select * from Loan where Plan_Id IS NOT NULL AND MStatus IS NULL ", con);



这篇关于错误“没有给出所需参数的值”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 12:21
查看更多