我确定这是一个简单的问题,但我正在尝试将 2 列合并到一个新的输出列中,但没有任何运气。每次我得到一个“对象引用未设置为对象的实例”。错误
这是我的代码:
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
谢谢您的帮助!