本文介绍了使用C#ASP.NET程序自动生成数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下提及我的代码
我想针对每个TransmittleNo生成一个编号,该编号已存在于名为T_doc_Control的表中.

Below mention my code
I want to generate number against each TransmittleNo which is already exist in table called T_doc_Control.

query = "Select Distinct TransmittleNo as TransNo from Temp_Doc Order By TransmittleNo";
                   ds = null;
                   ds = con.get_records(query);
                   if (ds.Tables[0].Rows.Count > 0)
                   {
                       for (int inti = 0; inti < ds.Tables[0].Rows.Count; inti++)
                       {
                       strTransmittleNo = ds.Tables[0].Rows[0]["TransNo"].ToString();
                       //strTransmittleSeq = "0";
                       strPentaTransmittleNo = "";

                       query = "Select decode(max(TransmittleSeq)+1,null,1,max(TransmittleSeq)+1) as TransSeqNo from T_Doc_Control Where TransmittleNo = '" + strTransmittleNo + "' And TransmittleDate = '" + strIssueDate.Trim()  + "' And TransmittleSeq is not null"; // +strTransmittleNo + "'";
                       dsGrid = null;
                       dsGrid = con.get_records(query);
                       if (dsGrid.Tables[0].Rows.Count > 0)
                       {
                           strPentaTransmittleNo = "PGM-TransmittleNo-" + dsGrid.Tables[0].Rows[0]["TransSeqNo"].ToString();
                           strTransmittleSeq = dsGrid.Tables[0].Rows[0]["TransSeqNo"].ToString();
                       }

                       query = "Update T_DOC_Control set PentaTransmittleNo = '" + strPentaTransmittleNo + "',";
                       query = query + "TransmittleSeq = " + strTransmittleSeq + " ";
                       query = query + "Where TransmittleNo = '" + strTransmittleNo + "' And PentaTransmittleNo IS NULL";
                       intResult = con.insert_records(query);
                       }
                   }


推荐我!!!


suggest me please !!

推荐答案

SELECT TOP 1 ChargebyMonth FROM tblsociety
ORDER BY NEWID()



并致电结果购买您的应用



and call result buy your app


这篇关于使用C#ASP.NET程序自动生成数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 21:11