# 有關欄位比對問題

• ### 一般討論

• 各位大大你們好

我想請問一下

之後當drow有值時

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

If drow Is Nothing Then
Return
Else
'str_select += " FROM tblWEBOrderHEAD "
'str_select += " WHERE INVNO IS NOT Nullable "

'正式機用

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

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:56 發問者自行解決且未提出解決方法。
2012年1月5日 上午 04:06

### 所有回覆

• 各位大大你們好

我想請問一下

之後當drow有值時

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

If drow Is Nothing Then
Return
Else
'str_select += " FROM tblWEBOrderHEAD "
'str_select += " WHERE INVNO IS NOT Nullable "

'正式機用

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

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