Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ProcessInputRow failure Expand / Collapse
Author
Message
Posted Monday, June 3, 2013 2:42 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, March 21, 2014 2:32 PM
Points: 25, Visits: 178
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;
}
Post #1459465
Posted Tuesday, June 4, 2013 1:03 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:52 PM
Points: 5,317, Visits: 12,353
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1459568
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse