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 :-
<Bimlxmlns="http://schemas.varigence.com/biml.xsd">
<ContainerName="Load Data Truncate Staging"ConstraintMode="Parallel"DelayValidation="true">
<Tasks>
<DataflowName="Archive Data"DelayValidation="true">
<Transformations>
<OleDbSourceName="Source"ConnectionName="DataStaging"ValidateExternalMetadata="false"LocaleId="None">
<VariableInputVariableName="User.V_Archivequery" />
</OleDbSource>
<RowCountName="Count Source Records"VariableName="User.sourceRecords"/>-->
<ScriptComponentTransformationProjectCoreName="MMd5"Name="MD5_Checksum">
<ScriptComponentProject>
<ScriptComponentProjectProjectCoreName="SC_Example.csproj"Name="ExampleScriptComponent">
<AssemblyReferences>
<AssemblyReferenceAssemblyPath="Microsoft.SqlServer.DTSPipelineWrap" />
<AssemblyReferenceAssemblyPath="Microsoft.SqlServer.DTSRuntimeWrap" />
<AssemblyReferenceAssemblyPath="Microsoft.SqlServer.PipelineHost" />
<AssemblyReferenceAssemblyPath="Microsoft.SqlServer.TxScript" />
<AssemblyReferenceAssemblyPath="System.Windows.Forms.dll" />
<AssemblyReferenceAssemblyPath="System.dll" />
<AssemblyReferenceAssemblyPath="System.AddIn.dll" />
<AssemblyReferenceAssemblyPath="System.Data.dll" />
<AssemblyReferenceAssemblyPath="System.Xml.dll" />
</AssemblyReferences>
<Files>
<FilePath="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>
<FilePath="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>
<InputBufferName="Input0">
</InputBuffer>
<OutputBuffers>
<OutputBufferName="Output0">
<Columns>
<ColumnName="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
Thankx & regards, Vipin jha MCP