SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


ProcessInputRow failure


ProcessInputRow failure

Author
Message
bobd125
bobd125
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 195
I need help trying to figure out what caused this error. I threw some Messagebox.Show in the script but they never get to appear? I'm not that familiar with scripts, I inherited this SSIS from previous developer.

Unable to cast object of type 'System.String' to type 'Microsoft.SqlServer.Dts.Pipeline.BlobColumn'.
at Input0Buffer.get_ENTR()
at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)
at UserComponent.Input0_ProcessInput(Input0Buffer Buffer)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

public override void Input0_ProcessInputRow(Input0Buffer Row)
{
MessageBox.Show("Processing");
agData += blobToString(Row.AG);
carlData += blobToString(Row.CARL);
fmnData += blobToString(Row.FMN);
entrData += blobToString(Row.ENTR);
}

private string blobToString(Microsoft.SqlServer.Dts.Pipeline.BlobColumn blob)
{
string result = "";
try
{
if (blob != null)
{
result = System.Text.Encoding.Unicode.GetString(blob.GetBlobData(0, Convert.ToInt32(blob.Length)));
}
}
catch (Exception ex)
{
MessageBox.Show("In the catch block" + ex);
result = ex.Message;
}
return result;
}
Phil Parkin
Phil Parkin
SSC-Forever
SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)

Group: General Forum Members
Points: 48767 Visits: 21132
bobd125 (6/3/2013)
I need help trying to figure out what caused this error. I threw some Messagebox.Show in the script but they never get to appear? I'm not that familiar with scripts, I inherited this SSIS from previous developer.

Unable to cast object of type 'System.String' to type 'Microsoft.SqlServer.Dts.Pipeline.BlobColumn'.
at Input0Buffer.get_ENTR()
at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)
at UserComponent.Input0_ProcessInput(Input0Buffer Buffer)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

public override void Input0_ProcessInputRow(Input0Buffer Row)
{
MessageBox.Show("Processing");
agData += blobToString(Row.AG);
carlData += blobToString(Row.CARL);
fmnData += blobToString(Row.FMN);
entrData += blobToString(Row.ENTR);
}

private string blobToString(Microsoft.SqlServer.Dts.Pipeline.BlobColumn blob)
{
string result = "";
try
{
if (blob != null)
{
result = System.Text.Encoding.Unicode.GetString(blob.GetBlobData(0, Convert.ToInt32(blob.Length)));
}
}
catch (Exception ex)
{
MessageBox.Show("In the catch block" + ex);
result = ex.Message;
}
return result;
}


Looks like your blobTOString() function is trying to return a string from a blob. But the error message suggests that one of the arguments to the functions is already a string.

What are the datatypes of the columns AG, CARL, FMN and ENTR? If any one of them is already string, I think that that is what would cause this.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search