Variables in Script Component


hi guys,

i have code writes on 3 variables.

 dim arr() string
    dim ch char()
    dim delimstring string = ","
    dim varlist variables
    dim strbrand string
    dim strbusinessdate string
    dim strstore string

public sub new()
        ch = delimstring.tochararray()
    end sub

public overrides sub postexecute()
        varlist
            .vbrand = strbrand
            .vbusinessdate = strbusinessdate
            .vstore = strstore
        end with

        mybase.postexecute()
    end sub

public overrides sub input0_processinputrow(byval row input0buffer)
        try
            dim rowvalues string = row.column0.replace("""", "")
            dim rowvalues1 string = row.column1.replace("""", "")

            arr = rowvalues1.split(ch)

            select case rowvalues.trim()
                case "date"
                    strbusinessdate = rowvalues1.trim()
                    exit select

                case "company number"
                    strbrand = rowvalues1.trim()
                    exit select

                case "store"
                    strstore = rowvalues1.trim()
                    exit select
end select
            row.businessdate = formatdate(strbusinessdate)
            row.storecode = padzero(strstore)
            row.brand = strbrand

end sub

and giving me error of

[transformed tlog format table format [55]] error: system.nullreferenceexception: object reference not set instance of object.
   @ microsoft.sqlserver.dts.pipeline.scriptcomponenthost.handleuserexception(exception e)
   @ microsoft.sqlserver.dts.pipeline.scriptcomponenthost.postexecute()
   @ microsoft.sqlserver.dts.pipeline.managedcomponenthost.hostpostexecute(idtsmanagedcomponentwrapper100 wrapper)

what problem?

thanks,

hi todd,

i test code again time removed variables , leave string. works now.

thanks opinion.

thanks,



SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........