none
有關欄位比對問題 RRS feed

  • 一般討論

  • 各位大大你們好

    我想請問一下

    我把XML轉成dataset之後 取欄位值跟get_TBLWEBORDERHEAD_Receipt的dataset做比對

    drow = ds.Tables(0).Rows.Find(get_TBLWEBORDERHEAD_Receipt) '比對資料的變數

    之後當drow有值時

    則會轉出xml把drow = ds.Tables(0).Rows.Find(get_TBLWEBORDERHEAD_Receipt)這裡面的值放入到

    Print(1, "<TaxNO>" + drData.GetValue(drData.GetOrdinal("Receipt")) + "</TaxNO>")這裡面

     drow = ds.Tables(0).Rows.Find(get_TBLWEBORDERHEAD_Receipt) '比對資料的變數

            If drow Is Nothing Then
                Return
            Else
                'str_select = " SELECT DISTINCT ORDERHEADDATE,INVAMOUNT,LEADCD||INVNO AS Receipt"
                'str_select += " FROM tblWEBOrderHEAD "
                'str_select += " WHERE INVNO IS NOT Nullable "

                '正式機用
                Dim drData As OracleDataReader = OracleHelper.ExecuteReader(str_DBConn, CommandType.Text, str_select)

                FileOpen(1, "D:\return_data_2.txt", OpenMode.Output)
                Print(1, "<?xml version=""1.0"" encoding=""Big5""?>")
                Print(1, "<Result>")
                Do Until drData.Read = False


                    Dim strDate As DateTime = DateTime.Parse(drData.GetValue(drData.GetOrdinal("ORDERHEADDATE")))
                    Dim s As String = strDate.ToString("yyyyMMdd")

                    Print(1, "<Data>")
                    Print(1, "<OrderType>" + "1" + "</OrderType>")
                    Print(1, "<TaxNO>" + drData.GetValue(drData.GetOrdinal("Receipt")) + "</TaxNO>")
                    Print(1, "<TaxDate>" + s + "</TaxDate>")
                    Print(1, "<Amt>" + Convert.ToString(drData.GetValue(drData.GetOrdinal("INVAMOUNT"))) + "</Amt>")
                    Print(1, "<OrderNo>" + "" + "</OrderNo>")
                    Print(1, "<ReturnNo>" + "" + "</ReturnNo>")
                    Print(1, "<ReturnDate>" + "" + "</ReturnDate>")
                    Print(1, "<ValidDate>" + "" + "</ValidDate>")
                    Print(1, "<SendDate>" + "" + "</SendDate>")
                    Print(1, "<Status>" + "1" + "</Status>")
                    Print(1, "<ErrMsg>" + "" + "</ErrMsg>")
                    Print(1, "</Data>")

                    'Me.Label4.Text = drData.GetValue(drData.GetOrdinal("Receipt"))
                    'Me.Label5.Text = s
                    'Me.Label6.Text = Convert.ToString(drData.GetValue(drData.GetOrdinal("INVAMOUNT")))
                Loop

    不曉得如何寫才是正確的 請各位大大不吝教導

    非常謝謝各位大大

    • 已變更類型 小朱MVP, Moderator 2012年1月5日 上午 06:56 發問者自行解決且未提出解決方法。
    2012年1月5日 上午 04:06

所有回覆

  • 各位大大你們好

    我想請問一下

    我把XML轉成dataset之後 取欄位值跟get_TBLWEBORDERHEAD_Receipt的dataset做比對

    drow = ds.Tables(0).Rows.Find(get_TBLWEBORDERHEAD_Receipt) '比對資料的變數

    之後當drow有值時

    則會轉出xml把drow = ds.Tables(0).Rows.Find(get_TBLWEBORDERHEAD_Receipt)這裡面的值放入到

    Print(1, "<TaxNO>" + drData.GetValue(drData.GetOrdinal("Receipt")) + "</TaxNO>")這裡面

     drow = ds.Tables(0).Rows.Find(get_TBLWEBORDERHEAD_Receipt) '比對資料的變數

            If drow Is Nothing Then
                Return
            Else
                'str_select = " SELECT DISTINCT ORDERHEADDATE,INVAMOUNT,LEADCD||INVNO AS Receipt"
                'str_select += " FROM tblWEBOrderHEAD "
                'str_select += " WHERE INVNO IS NOT Nullable "

                '正式機用
                Dim drData As OracleDataReader = OracleHelper.ExecuteReader(str_DBConn, CommandType.Text, str_select)

                FileOpen(1, "D:\return_data_2.txt", OpenMode.Output)
                Print(1, "<?xml version=""1.0"" encoding=""Big5""?>")
                Print(1, "<Result>")
                Do Until drData.Read = False


                    Dim strDate As DateTime = DateTime.Parse(drData.GetValue(drData.GetOrdinal("ORDERHEADDATE")))
                    Dim s As String = strDate.ToString("yyyyMMdd")

                    Print(1, "<Data>")
                    Print(1, "<OrderType>" + "1" + "</OrderType>")
                    Print(1, "<TaxNO>" + drData.GetValue(drData.GetOrdinal("Receipt")) + "</TaxNO>")
                    Print(1, "<TaxDate>" + s + "</TaxDate>")
                    Print(1, "<Amt>" + Convert.ToString(drData.GetValue(drData.GetOrdinal("INVAMOUNT"))) + "</Amt>")
                    Print(1, "<OrderNo>" + "" + "</OrderNo>")
                    Print(1, "<ReturnNo>" + "" + "</ReturnNo>")
                    Print(1, "<ReturnDate>" + "" + "</ReturnDate>")
                    Print(1, "<ValidDate>" + "" + "</ValidDate>")
                    Print(1, "<SendDate>" + "" + "</SendDate>")
                    Print(1, "<Status>" + "1" + "</Status>")
                    Print(1, "<ErrMsg>" + "" + "</ErrMsg>")
                    Print(1, "</Data>")

                    'Me.Label4.Text = drData.GetValue(drData.GetOrdinal("Receipt"))
                    'Me.Label5.Text = s
                    'Me.Label6.Text = Convert.ToString(drData.GetValue(drData.GetOrdinal("INVAMOUNT")))
                Loop

    不曉得如何寫才是正確的 請各位大大不吝教導

    非常謝謝各位大大

    這問題 解決了 非常感謝各位大大
    2012年1月5日 上午 06:26