| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3098 人关注过本帖
标题:value(:字段)中的冒号是啥意思。。或者这么写的作用是》??
只看楼主 加入收藏
绝伦
Rank: 1
等 级:新手上路
帖 子:67
专家分:3
注 册:2011-10-10
结帖率:63.64%
收藏
已结贴  问题点数:10 回复次数:4 
value(:字段)中的冒号是啥意思。。或者这么写的作用是》??
private Boolean SaveBaseInfo()
        {
            
            OracleDB db = new OracleDB();
            string cmd = "SELECT * FROM LFSMELTBASEINFO WHERE JLCLH = '" + baseInfo.CLH + "'";
            DBTable dt = db.Select(cmd);
            int num = dt.RowCount;
            if (num == 0)
            {
                cmd = "INSERT INTO LFSMELTBASEINFO (" +
                            "JLCLH, LH,  CLH, GZ, BZLX," +
                            "ZH, GBH, GBCS, LGCS, BC, BZ, " +
                            "DZGSZL, DZSJ, CZSJ, YLKSSJ, YLJSSJ," +
                            "CGGSZL, DHL, CYL, CDL, TDSJ, YLSJ, " +
                            "CYSJ, DZWD, CZWD, CGYH, YLTJ, SYJH, " +
                            "JSTJ, QTGD, APP, GENO,GKNO,"+
                            "OPERATOR,YINGSHI,DIANSHI,FANTU,SHIHUI,"+
                            "MAIHUZHA_CODE,WEIGHT_MAIHUZHA,BAOWENJI_CODE,WEIGHT_BOWENJI,CEWENTOU,"+
                            "OUTOU,QUYANGQI,POWER_A,POWER_B,POWER_C,"+
                            "LUGAI_YALI,LUGAI_LIULIANG,OXYGEN_VALUE_FOR_ARRIVAL,ZHAHOU,XLOOP,"+
                            "AY1, AY2) VALUES(" +
                            ":JLCLH, :LH, :CLH, :GZ, :BZLX," +
                            ":ZH, :GBH, :GBCS, :LGCS, :BC, :BZ," +
                            ":DZGSZL, :DZSJ, :CZSJ, :YLKSSJ, :YLJSSJ," +
                            ":CGGSZL, :DHL, :CYL, :CDL, :TDSJ, :YLSJ," +
                            ":CYSJ, :DZWD, :CZWD, :CGYH, :YLTJ, :SYJH," +
                            ":JSTJ, :QTGD, :APP, :GENO,:GKNO," +
                            ":OPERATOR,:YINGSHI,:DIANSHI,:FANTU,:SHIHUI," +
                            ":MAIHUZHA_CODE,:WEIGHT_MAIHUZHA,:BAOWENJI_CODE,:WEIGHT_BOWENJI,:CEWENTOU," +
                            ":OUTOU,:QUYANGQI,:POWER_A,:POWER_B,:POWER_C," +
                            ":LUGAI_YALI,:LUGAI_LIULIANG,:OXYGEN_VALUE_FOR_ARRIVAL,:ZHAHOU,:XLOOP," +
                            ":AY1, :AY2)";
            }
            else
            {
                cmd = "UPDATE LFSMELTBASEINFO SET " +
                    "CLH = :CLH, LH = :LH, GZ = :GZ, BZLX = :BZLX, " +
                    "ZH = :ZH, GBH = :GBH, GBCS = :GBCS, LGCS = :LGCS, BC = :BC, BZ = :BZ," +
                    "DZGSZL = :DZGSZL, DZSJ = :DZSJ, CZSJ = :CZSJ, YLKSSJ = :YLKSSJ, YLJSSJ = :YLJSSJ, " +
                    "CGGSZL = :CGGSZL, DHL = :DHL, CYL = :CYL, CDL = :CDL, TDSJ = :TDSJ, YLSJ = :YLSJ, " +
                    "CYSJ = :CYSJ, DZWD = :DZWD, CZWD = :CZWD, CGYH = :CGYH, YLTJ = :YLTJ, SYJH = :SYJH, " +
                    "JSTJ = :JSTJ, QTGD = :QTGD, APP = :APP,GENO = :GENO,GKNO = :GKNO," +
                    "OPERATOR = :OPERATOR,YINGSHI = :YINGSHI,DIANSHI = :DIANSHI,FANTU = :FANTU,SHIHUI = :SHIHUI," +
                    "MAIHUZHA_CODE = :MAIHUZHA_CODE,WEIGHT_MAIHUZHA = :WEIGHT_MAIHUZHA,BAOWENJI_CODE = :BAOWENJI_CODE,WEIGHT_BOWENJI = :WEIGHT_BOWENJI,CEWENTOU = :CEWENTOU," +
                    "OUTOU = :OUTOU,QUYANGQI = :QUYANGQI,POWER_A = :POWER_A,POWER_B = :POWER_B,POWER_C = :POWER_C," +
                    "LUGAI_YALI = :LUGAI_YALI,LUGAI_LIULIANG = :LUGAI_LIULIANG,OXYGEN_VALUE_FOR_ARRIVAL = :OXYGEN_VALUE_FOR_ARRIVAL,ZHAHOU = :ZHAHOU,XLOOP = :XLOOP, AY1 = :AY1, AY2 = :AY2 WHERE JLCLH = :JLCLH";
            }

            if (baseInfo.CLH == null) baseInfo.CLH = baseInfo.LH + DateTime.Now.ToString("HHmmss");
            num = db.ExecNonQuery(cmd,
                       "JLCLH", System.Data.OracleClient.OracleType.VarChar, baseInfo.CLH,
                       "LH", System.Data.OracleClient.OracleType.VarChar, baseInfo.LH,
                        "CLH", System.Data.OracleClient.OracleType.VarChar, baseInfo.JLH,
                        "GZ", System.Data.OracleClient.OracleType.VarChar, baseInfo.GZ,
                       "BZLX", System.Data.OracleClient.OracleType.VarChar, baseInfo.BZ,

                       "ZH", System.Data.OracleClient.OracleType.VarChar, (VechNum + 1).ToString(),
                       "GBH", System.Data.OracleClient.OracleType.VarChar, deviceInfo.GBH,
                       "GBCS", System.Data.OracleClient.OracleType.Int32, deviceInfo.GBCS,
                       "LGCS", System.Data.OracleClient.OracleType.Int32, deviceInfo.LGCS,
                       "BC", System.Data.OracleClient.OracleType.VarChar, (int)others.BB,
                       "BZ", System.Data.OracleClient.OracleType.VarChar, (int)others.BC,

                       "DZGSZL", System.Data.OracleClient.OracleType.Float, inInfo.JZZL,
                       "DZSJ", System.Data.OracleClient.OracleType.DateTime, inInfo.JZSJ,
                       "CZSJ", System.Data.OracleClient.OracleType.DateTime, outInfo.CZSJ,
                       "YLKSSJ", System.Data.OracleClient.OracleType.DateTime, inInfo.JZSJ.AddSeconds(conInfo.SDKSSJ),
                       "YLJSSJ", System.Data.OracleClient.OracleType.DateTime, inInfo.JZSJ.AddSeconds(conInfo.SDKSSJ + conInfo.TDSJ),

                       "CGGSZL", System.Data.OracleClient.OracleType.Float, outInfo.CZZL,
                       "DHL", System.Data.OracleClient.OracleType.Float, conInfo.DH,
                       "CYL", System.Data.OracleClient.OracleType.Float, conInfo.YH,
                       "CDL", System.Data.OracleClient.OracleType.Float, 0,
                       "TDSJ", System.Data.OracleClient.OracleType.Int32, conInfo.TDSJ,
                       "YLSJ", System.Data.OracleClient.OracleType.Int32, conInfo.YLSJ,

                       "CYSJ", System.Data.OracleClient.OracleType.Int32, conInfo.YLSJ,
                       "DZWD", System.Data.OracleClient.OracleType.Int32, inInfo.JZWD,
                       "CZWD", System.Data.OracleClient.OracleType.Int32, outInfo.CZWD,
                       "CGYH", System.Data.OracleClient.OracleType.VarChar, outInfo.CGYH,
                       "YLTJ", System.Data.OracleClient.OracleType.VarChar, others.YLTJ,
                       "SYJH", System.Data.OracleClient.OracleType.VarChar, others.SYJH,

                       "JSTJ", System.Data.OracleClient.OracleType.VarChar, others.JSTJ,
                       "QTGD", System.Data.OracleClient.OracleType.VarChar, others.QTGD,
                       "APP", System.Data.OracleClient.OracleType.VarChar, others.BZH,
                       "GENO", System.Data.OracleClient.OracleType.VarChar, jgInfo.GE,
                       "GKNO", System.Data.OracleClient.OracleType.VarChar, jgInfo.GK,

                       "OPERATOR", System.Data.OracleClient.OracleType.VarChar, jgInfo2.OPER,
                       "YINGSHI", System.Data.OracleClient.OracleType.Int32, jgInfo2.YS,
                       "DIANSHI", System.Data.OracleClient.OracleType.Int32, jgInfo2.DS,
                       "FANTU", System.Data.OracleClient.OracleType.Int32, jgInfo2.FT,
                       "SHIHUI", System.Data.OracleClient.OracleType.Int32, jgInfo2.SH,


                       "MAIHUZHA_CODE", System.Data.OracleClient.OracleType.VarChar, jgInfo2.MHZLX,
                       "WEIGHT_MAIHUZHA", System.Data.OracleClient.OracleType.Int32, jgInfo2.MHZ,
                       "BAOWENJI_CODE", System.Data.OracleClient.OracleType.VarChar, jgInfo2.BWJLX,
                       "WEIGHT_BOWENJI", System.Data.OracleClient.OracleType.Int32, jgInfo2.BWJ,
                       "CEWENTOU", System.Data.OracleClient.OracleType.Int32, jgInfo2.CWT,

                       "OUTOU", System.Data.OracleClient.OracleType.Int32, jgInfo2.TO,
                       "QUYANGQI", System.Data.OracleClient.OracleType.Int32, jgInfo2.QYQ,
                       "POWER_A", System.Data.OracleClient.OracleType.VarChar, (jgInfo.A_ELE ? "1" : "0"),
                       "POWER_B", System.Data.OracleClient.OracleType.VarChar, (jgInfo.B_ELE ? "1" : "0"),
                       "POWER_C", System.Data.OracleClient.OracleType.VarChar, (jgInfo.C_ELE ? "1" : "0"),

                       "LUGAI_YALI", System.Data.OracleClient.OracleType.Int32, (int)jgInfo.CoverPress,
                       "LUGAI_LIULIANG", System.Data.OracleClient.OracleType.Int32, (int)jgInfo.CoverFlow,
                       "OXYGEN_VALUE_FOR_ARRIVAL", System.Data.OracleClient.OracleType.Float, jgInfo.InO2,
                       "ZHAHOU", System.Data.OracleClient.OracleType.Float, jgInfo.SlagHeight,
                       "XLOOP", System.Data.OracleClient.OracleType.VarChar, jgInfo.XLOOP.ToString(),


                       "AY1", System.Data.OracleClient.OracleType.VarChar, null,
                       "AY2", System.Data.OracleClient.OracleType.VarChar, null
                       );
            return num > 0;
        }
搜索更多相关主题的帖子: private 
2012-02-01 09:19
lj_a_b
Rank: 2
等 级:论坛游民
帖 子:29
专家分:10
注 册:2012-1-9
收藏
得分:5 
我的理解是将value中的变量与上面不带冒号的变量区别开。
2012-02-01 09:36
绝伦
Rank: 1
等 级:新手上路
帖 子:67
专家分:3
注 册:2011-10-10
收藏
得分:0 
回复 2楼 lj_a_b
现在的情况是我想找到他的带冒号的:JZGSZL的值具体是多少 怎么来的????
2012-02-01 10:08
wangnannan
Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18
等 级:贵宾
威 望:87
帖 子:2546
专家分:9359
注 册:2007-11-3
收藏
得分:5 
冒号传参数用的 需要用参数替换

出来混,谁不都要拼命的嘛。 。拼不赢?那就看谁倒霉了。 。有机会也要看谁下手快,快的就能赢,慢。 。狗屎你都抢不到。 。还说什么拼命?
2012-02-01 10:41
lj_a_b
Rank: 2
等 级:论坛游民
帖 子:29
专家分:10
注 册:2012-1-9
收藏
得分:0 
回复 3楼 绝伦
你这个程序是全的吗,我认为应该有给这个变量赋值的地方,我也是初学者,可能说的不对,只是给个参考。
2012-02-01 11:12
快速回复:value(:字段)中的冒号是啥意思。。或者这么写的作用是》??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027417 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved