2010-01-06 87 views
0
在SSIS的腳本組件拋出錯誤的字符串的

獲取子:SSIS腳本部件錯誤

Index and length must refer to a location within the string. Parameter name: length

at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row) at UserComponent.Input0_ProcessInput(Input0Buffer Buffer) at UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

代碼:

public override void Input0_ProcessInputRow(Input0Buffer Row) 
{ 
    Row.ORGANISATIONPROVIDERSOURCEIDOut = Row.ORGANISATIONPROVIDERSOURCEID.Substring(0,19); 
    Row.ORGANISATIONPROVIDERIDOut = Row.ORGANISATIONPROVIDERID; 
} 

任何幫助,請。

感謝

回答

0

該錯誤意味着你的ORGANISATIONPROVIDERSOURCEID字符串少於19個字符。 SubString函數的第二個參數(長度)不能大於文本的長度。