C/S 客户端数据错误

hongwei_23 2009-08-11 11:03:50
现在有个C#编写的ERP程序 在数据库里取值放到前台 但是现在有一部分客户端显示正确值(2800) 一部分客户端显示错误值(这个值比真实值小,是2241) ,后台代码是一样的,为什么两台机器有这个差异呢
这是什么原因 大家有遇到过吗 ?
...全文
117 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hongwei_23 2009-08-11
  • 打赏
  • 举报
回复
很奇怪 为什么有的机器显示正确值呢
hao1hao2hao3 2009-08-11
  • 打赏
  • 举报
回复


设置断点跟踪一下SQL语句吧!看看取值的情况。
hongwei_23 2009-08-11
  • 打赏
  • 举报
回复
用户名都是管理员的帐户
fengjian_428 2009-08-11
  • 打赏
  • 举报
回复
看代码才知道
hongwei_23 2009-08-11
  • 打赏
  • 举报
回复
double byzgsl = 0;
double byzgje = 0;
//单据和运费以及初始数据继续暂估入库(Inclassify=16或21或41)
dt = bs.getDatabySQL("Data", "select isnull(sum(sl),0) as sl,isnull(sum(je6),0) as je from Material_ViewStoreHouseIn where (inclassify=15 or inclassify=21 or inclassify=41) and (inventorycoding='" + txtCoding.Text + "') and (date>='" + dpby1.Value.ToString("yyyy-MM-dd") + "') and (date<='" + dp3.Value.ToString("yyyy-MM-dd") + "')and(StoreHouseCoding='" + Convert.ToString(StoreHouse.Tag) + "')and(GoodsPlaceCoding='" + Convert.ToString(GoodsPlace.Tag) + "') and (invoicestate='未到') and (checkflag=1)");
if (dt.Rows.Count > 0)
{
double sl = Convert.ToDouble(dt.Rows[0]["sl"]);
sl = num(sl.ToString("f3"));

byzgsl += sl;
byzgje += Convert.ToDouble(dt.Rows[0]["je"]);
}
else
{
byzgsl = 0;
byzgje = 0;
}
//正常入库但是发票没到
dt = bs.getDatabySQL("Data", "select isnull(sum(sl),0) as sl,isnull(sum(je6),0) as je from Material_ViewStoreHouseIn where (inventorycoding='" + txtCoding.Text + "') and (invoicestate='未到') and inclassify=1 and (isnull(hostname,'')='')and(StoreHouseCoding='" + Convert.ToString(StoreHouse.Tag) + "')and(GoodsPlaceCoding='" + Convert.ToString(GoodsPlace.Tag) + "') and date>='" + rq1 + "' and date<='" + rq2 + "'");
if (dt.Rows.Count > 0)
{
byzgsl += Convert.ToDouble(dt.Rows[0]["sl"]);
byzgje += Convert.ToDouble(dt.Rows[0]["je"]);
}
else
{
byzgsl = 0;
byzgje = 0;
}
txtSL4.Text = byzgsl.ToString("0.0000");
txtJE4.Text = byzgje.ToString("0.00");
jwdream2008 2009-08-11
  • 打赏
  • 举报
回复
应该不会是这样吧!呵呵!
个人感觉是取值的时候,根据客户的不同取出来了不同的值啊!
检查一下业务逻辑吧!
hao1hao2hao3 2009-08-11
  • 打赏
  • 举报
回复
贴代码看看。

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧