How to get all input columns of script components checked by default to use the same in code ?

Jan 9, 2015 at 10:45 AM
Hi ,

I am working on BIML Script component, where I am taking data from OLEDB Source.

In Script Component I want all the input columns to be checked by default as input.
I have no idea how to proceed for the same.

Below is my code :-

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Container Name="Load Data Truncate Staging" ConstraintMode="Parallel" DelayValidation="true" >
<Tasks>
<Dataflow Name="Archive Data" DelayValidation="true" >
<Transformations>
<OleDbSource Name="Source" ConnectionName="DataStaging" ValidateExternalMetadata="false" LocaleId="None" >
<VariableInput VariableName="User.V_Archivequery" />
</OleDbSource>
<RowCount Name="Count Source Records" VariableName="User.sourceRecords"/>-->
<ScriptComponentTransformation ProjectCoreName="MMd5" Name="MD5_Checksum">
<ScriptComponentProject>
<ScriptComponentProject ProjectCoreName="SC_Example.csproj" Name="ExampleScriptComponent">
<AssemblyReferences>
<AssemblyReference AssemblyPath="Microsoft.SqlServer.DTSPipelineWrap" />
<AssemblyReference AssemblyPath="Microsoft.SqlServer.DTSRuntimeWrap" />
<AssemblyReference AssemblyPath="Microsoft.SqlServer.PipelineHost" />
<AssemblyReference AssemblyPath="Microsoft.SqlServer.TxScript" />
<AssemblyReference AssemblyPath="System.Windows.Forms.dll" />
<AssemblyReference AssemblyPath="System.dll" />
<AssemblyReference AssemblyPath="System.AddIn.dll" />
<AssemblyReference AssemblyPath="System.Data.dll" />
<AssemblyReference AssemblyPath="System.Xml.dll" />
</AssemblyReferences>
<Files>
<File Path="Properties\AssemblyInfo.cs">
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("SC_Example.csproj")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ciber Nederland")]
[assembly: AssemblyProduct("SC_Example.csproj")]
[assembly: AssemblyCopyright("Copyright @ Ciber Nederland 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.*")]
</File>
<File Path="main.cs">
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Reflection;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
string strColumnsValue = string.Empty;
Type rowType = Row.GetType();
PropertyInfo columnProperty;
MD5 md5 = new MD5CryptoServiceProvider();
Encoder enc = System.Text.Encoding.Unicode.GetEncoder();

foreach(IDTSInputColumn100 Rw in this.ComponentMetaData.InputCollection[0].InputColumnCollection)
{
columnProperty = rowType.GetProperty(Rw.Name);
strColumnsValue += Convert.ToString(columnProperty.GetValue(Row,null));
}
byte[] bbb = new byte[strColumnsValue.Length * 3];
bbb = UnicodeEncoding.Unicode.GetBytes(strColumnsValue);
byte[] hash = md5.ComputeHash(bbb);
String strHash = Convert.ToBase64String(hash);
Row.RowChecksum = strHash;
}
}
</File>

</Files>


<InputBuffer Name="Input0">

</InputBuffer>
<OutputBuffers>

<OutputBuffer Name="Output0">
<Columns>
   <Column Name="RowChecksum" DataType="String" Length="1000"/>
</Columns>
</OutputBuffer>
</OutputBuffers>
</ScriptComponentProject>
</ScriptComponentProject>
</ScriptComponentTransformation>

</Transformations>
</Dataflow>
</Tasks>
</Container>


</Tasks>
</Package>
</Packages>
</Biml>

Please suggest me where i am doing mistake.


Regards,
Vipin jha
ImageImage