Home » C# ProgrammingRSS

Exception before it goes to Break point line in Script Component

it seems me to be Bad Data, but I can not catch this exception.

After my OleDb source, I am calling script component for Data tranformation, I out Break point on various location

like UserComponent.ProcessInput definition.and on all the method in ScriptMain class.

Error message of "Object reference not set to an instance of an object."

I get following error detail

 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).

 

Can any body suggest how to catch this error.

 

Thanks,

Joshi

 

7 Answers Found

 

Answer 1

From my little experience, breakpoints inside data  flows (script components or not, but specially script  components) don't work.

Use System.Diagnostics.Trace, run the package with DTExec.exe and see the output in DebugView.

 

Answer 2

Paulo is correct - script  components can't be debugged with breakpoints, allegedly due to the threading involved in the pipeline.

I prefer using ComponentMetaData.FireInformation instead of the calls from the Diagnostics namespace.

 

Answer 3

It seems to me that none of my break  point are working..which is separate issue, but yet making the one above more complicate.

Is not catching Break point  in the Script Component is known issue.

 

 

Answer 4

Just be aware that, although it doesn't set  your package in fire, it does fire the OnInformation event that will be propagated up to the top level package (unless you explicitly tell it not to).

But that's the sure way to get runtime info in Visual Studio's ouput window.

 

Answer 5

None of your breakpoints in a script  component will work.  That's the definition  of "you can't use breakpoints in a script component."  They're not supported.  It's a known issue.  You can't use them.  Don't try.

Use FireInformation, or MessageBox.Show instead.

 

Answer 6

Thanks Paulo and Todd.

I used MessageBox.Show for now ,

I am going to explore more on System.Diagnostics.Trace

cause when I am processing thousands of record and multiple column per row, catching bad  data is vry tedious and time consuming.

 

 

 

Answer 7

You may want to use this technique instead: Using the data  Viewer Intelligently in SSIS Data Flows.
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter