Friday, 28 January 2011
BizTalk Envelop Schema - best explanation
Saturday, 25 September 2010
Interesting fact about Message Type in BizTalk
http://seroter.wordpress.com/2009/02/27/not-using-httpnamespaceroot-as-biztalk-message-type/
Monday, 18 May 2009
SSIS : Multiple output rows for single input row.
Multiple output rows for single input row.
Solution:
Step 1: Its very simple, read the file using Flat file Source

Step 2: Add a Script component, and check only those input column, which are required (to minimize the buffer size)

Step 3 : In Script component , go to the “Inputs and outputs ” section. Add new Output and give it a name e.g. “Currency”

Step 4: Add columns to new output “Currency”.

Step 5:
Write code similar to the following
' Alternative Fuel C4 Margine Amount
With CurrencyBuffer
.AddRow()
.SiteID = Row.LegacysiteID
.Currencycode = Row.CurrencyCode
.MonthId = Convert.ToInt32(Row.Month)
.YearID = Convert.ToInt32(Row.Year)
.Volumsrcode = Row.VolumeUnitofMeasureCode
.PerformanceMeasureID = 51
.FuelGradeCode = "7"
.FuelGradeDesc = Row.AlternativeFuelDesc
If Row.AlternativeFuelC4marginamt_IsNull = True Then
.Value = Nothing
Else
.Value = Convert.ToDecimal(Row.AlternativeFuelC4marginamt)
End If
MsgBox(Row.AlternativeFuelvolCurrentMth)
''Alternative Fuel Total Volume
.AddRow()
.SiteID = Row.LegacysiteID
.Currencycode = Row.CurrencyCode
.MonthId = Convert.ToInt32(Row.Month)
.YearID = Convert.ToInt32(Row.Year)
.Volumsrcode = Row.VolumeUnitofMeasureCode
.PerformanceMeasureID = 39
.FuelGradeCode = "7"
.FuelGradeDesc = Row.AlternativeFuelDesc
If Row.AlternativeFuelvolCurrentMth_IsNull = True Then
.Value = Nothing
Else
.Value = 123
End If
End With
Step 6:
While linking to the output to OLEDB Destination or any other component, choose output as Currency.

Output :

Saturday, 28 February 2009
Memory managment in c#
- The GC searches for managed objects that are referenced in managed code.
- The GC attempts to finalize objects that are not referenced.
- The GC frees objects that are not refernced and reclaim memory from them.
This is a fantastic blog on using finalize and and dispose method in C#
http://www.devx.com/dotnet/Article/33167/0/page/1.
Stack Vs Heap
Contents Value Types Objects
Stack Frames
Item Order LIFO Random
LifeTime Scope Reference Counter
Item Removal POP Garbage Collection
Timing Deterministic Non Deterministic
Please refer the following post for this http://en.csharp-online.net/Stack_vs._Heap
C# Variable : Value type and Reference Type
- Variables are declared as being of particular type.
- Each variable is constrained to hold only valuesof its declared type
In C# , there are two types of variable : Value Type and Reference Type
Value Type:
All value types are derived implicitly from the System.ValueType. It includes all predefined datatypes , Structs and Enumerators.
In the following code , two variables are declared and set with the integer values.
int x = 1;
int y = x;
y=2;
after this statement , x holds the value 1 and y holds the value 2.
Reference Type:
The predefined reference types are objects and string. User defined types are:
- Class
- Interface
- Delegate
Reference types actually hold the value of a memory address occupied by the object they reference .Consider the following piece of code , in which two variables are given a reference to the same object.
Object x = new Object();
x.newValue = 1
Object y = x
y.newValue = 2
After this statement both x.newValue and y.newValue equal to 2.
Strings , though they are reference type , they work more like value types.
String s1 = "Hello";
String s2 = s1;
s2 = "Bye";
After this statement s1 holds "Hello" and s2 holds "Bye".
Its because immutable property of the String and when the value of the s1 change , a new string object is created .
One should declare a type as a value type if all the following are true
- The type acts like a primitive type
- The type does not need to inherit from anyother type
- The type will not have any othe types derived from it.
- Objects of the type are not frequently passed as method arguments since this would cause frequent memory copy operation hurting performance.
Learn C# : Boxing and unboxing
http://msdn.microsoft.com/en-gb/magazine/cc301569.aspx
It cleard my concept on exactly how boxing and unboxing works. All the examples are very good and helped me to ubderstand this better