2010-01-06 93 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函数的第二个参数(长度)不能大于文本的长度。