我確定這是一個簡單的問題,但我試圖將2列合併到一個新的輸出列中,但沒有任何運氣。每次我得到'對象引用未設置爲對象的實例'。錯誤將值分配給SSIS腳本組件新的輸出列
這裏是我的代碼:
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Public Class ScriptMain
Inherits UserComponent
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
'
' Add your code here
'
Dim tmpStr As String
tmpStr = ""
If Not IsNumeric(Row.addrmap.ToString) Then
tmpStr = Row.addrmap.ToString.Substring(Row.addrmap.ToString.Length - 2, 1)
tmpStr = Row.addrmap.ToString.Remove(Row.addrmap.ToString.Length - 2, 1).PadLeft(3, CChar("0")) & " " & tmpStr.PadLeft(3, CChar("0")) & " " & Row.addrpar.ToString
Else
tmpStr = Row.addrmap.ToString.PadLeft(3, CChar("0")) & " " & "000 " & Row.addrpar.ToString
End If
Row.addrMapPar = tmpStr
End Sub
End Class
感謝您的幫助!
好的發現,感謝您發佈的答案。 – grapefruitmoon 2011-03-08 16:55:46