您好我想使用stringbuilder來替換回車換行符和文件中的任何位置的撇號。我使用SSIS中的VB腳本組件和每個循環,以便一個文件一次傳遞給str_SoucePath變量。 我有很多文件必須針對此腳本運行,但是當我針對任何文件運行它時,出現此錯誤。請告訴我什麼是錯的。Vb.net Stringbuilder替換大文件
異常已被調用的目標拋出。
這裏是我的代碼:(Dts.Variables( 「用戶:: str_SourcePath」)Value.ToString())
Public Sub Main()
Dim data As New StringBuilder(Dts.Variables("User::str_SourcePath").Value.ToString())
data.Replace(vbCr, vbLf)
data.Replace("'", "")
Console.WriteLine(Dts.Variables("User::str_SourcePath").Value.ToString())
Console.ReadLine()
Dts.TaskResult = ScriptResults.Success
End Sub
您想要發佈完整的異常,包括所有內部異常,而不僅僅是最外部異常的Message屬性。特別是,使用'ex.ToString()'會告訴你更多關於哪個「被對象調用引發的異常」。 –