当我执行此代码时错误显示“未找到栏目资金“这段代码中的错误是什么? [英] When I Execute This Code The Error Shows " Column Fundleft Is Not Found" Wthat Is The Mistake In This Code

查看:67
本文介绍了当我执行此代码时错误显示“未找到栏目资金“这段代码中的错误是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

con = new SqlConnection(cs);
           con.Open();
           cmd = con.CreateCommand();
           cmd = new SqlCommand("select distinct RTRIM(FundLeft) from Invoice ", con);
           rdr = cmd.ExecuteReader();


           while (rdr.Read())
           {

               DataRow[] dr = dt.Select("FundLeft = MIN(FundLeft)");
               txtfundleft.Text = dr[0][1].ToString();
           }
           con.Close();

推荐答案

错误信息非常明确:Column Fundleft is找不到

所以检查你的表格:你的发票表中是否有一栏Fundleft?我猜不是,而且你的意思完全不同。



当我们在这里时,那段代码就是......呃......很奇怪。

为什么使用Reader并忽略它返回的值?
The error message is pretty explicit: "Column Fundleft is not found"
So check your tables: is there a column "Fundleft" in your "Invoices" table? I'm guessing not, and that you meant a different table altogether.

And while we are here, that code is...um...rather odd.
Why are you using a Reader and ignoring the values it returns?


这篇关于当我执行此代码时错误显示“未找到栏目资金“这段代码中的错误是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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