January 17, 2011 at 10:45 am
Hello all,
I'm want to pass a script component row into my custom class for processing. See my class (added in script component) with the row passed in the constructor:
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute()> _
<CLSCompliant(False)> _
Public Class Account
Private _AccountStatusHistoryID As Integer
Private _ACCTNO As Double
Private _firstName As String
Private _lastName As String
Private _SSN As String
Private _DateOfBirth As Date
Private _ClaimsPaymentOption As Double
Private _DateAccountOpened As Date
Private _EffectiveDate As Date
Private _PartnerID As Integer
Private _AccountStatus As Double
Private _DateAccountClosed As Date
#Region "Public Properties"
'Properties here
#End Region
#Region "Public Constructors"
Public Sub New(ByVal dr As DataRow)
'More processing here
End Sub
Public Sub New(ByVal Row As InputDataBuffer)
_AccountStatusHistoryID = Row.ACCOUNTSTATUSHISTORYID
_ACCTNO = Row.ACCOUNTNUMBER
_firstName = Row.FIRSTNAME
_lastName = Row.LASTNAME
_SSN = Row.SSN
_DateOfBirth = Row.DATEOFBIRTH
_ClaimsPaymentOption = Row.CLAIMSPAYMENTOPTION
_DateAccountOpened = Row.OPENDATE
_EffectiveDate = Row.EFFECTIVEDATE
_PartnerID = Row.PARTNERID
_AccountStatus = Row.ACCOUNTSTATUS
_DateAccountClosed = Row.CLOSEDDATE
End Sub
#End Region
#Region "Public Methods"
Public Function Compare(ByVal account As Account) As Boolean
End Function
#End Region
End Class
In the error list in BIDS I have this error:
Error1Validation error. Data Flow Task: Data Flow Task: Microsoft.SqlServer.Dts.Pipeline.CannotCreateUserComponentException: Cannot create user component class. Make sure there is one class marked with SSISScriptComponentEntryPointAttribute in your script. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.CreateUserComponent()CreateDailyFiles.dtsx00
Not sure why since I do have SSISScriptComponentEntryPointAttribute in my script. Can anyone see what I'm missing?
Thanks,
Strick
January 20, 2011 at 10:50 am
This doesn't look like proper Script Component script. Your class has to inherit from UserComponent. The data being processed will be by default passed in <Your Input>_ProcessInputRow method, not your constructor.
Create a brand new script and let SSIS generate the default code for you, so you can see what your class should look like.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply