Tuesday, September 20, 2011

Structs in C#


Struct is very similar to a class but strcut is value type and class is reference type, .Net supports the value type and reference type unlike Java, in Java you can define only reference type.  Strcuts may leads to good performance where it’s used properly.

Reference types instances allocating in the managed heap and are garbage collected when there are no further references. Value types are allocated in the stack and so allocated memory is reclaimed as soon as their scope ends.  Using a value type instead reference type may result in fewer objects on the managed heap, which results less load to garbage collector (GC) and better performance.

Since for a value type, a compiler by default doesn’t generate a default constructor, struct doesn’t have parameter less constructor. And no finalizer, no virtual members and it derives only from System.ValuType, This System.ValueType may again derives from System.Object .    But structs can implement interfaces, in C# all primitive data types are value type except System.String
However value types have their poor sides too, when passing around big struct costlier than a reference type.

An example of declaring constructors.
    struct Point
    {
       private int x;
       private int y;

        public Point(int x, int y)
        {
            this.x = x;
            this.y = y;
        }
    }

An example of calling struct constructors.
              Point point1 = new Point();
            Point point2 = new Point(1,3);

Wednesday, September 14, 2011

Crystal Report Problems solving with Visual Studio 2010


CRVS2010 Beta - file not found error crdb_adoplus.dll  

An error when running the product when have installed CR 2010.

"Could not load file or assembly 'file:///C:
Program Files
SAP BusinessObjects
SAP BusinessObjects Enterprise XI 4.0
win32_x86
dotnet1
crdb_adoplus.dll' or one of its dependencies.

Solution

Setting the useLegacyV2RuntimeActivationPolicy flag to True does "solve" the problem. However, that is a hack and not a true fix. In trying to create a purely .NET 4.0 application, the end user shouldn't have to add this flag to get an application to work. Hopefully someone at SAP will note this and fix it in the core Crystal Reports functionality before the final version for VS 2010 is released.

Add following section to your config file and it may resolve the issue.
<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0"/>
</startup>

Sunday, July 31, 2011

How to add Crystal Report for Visual Studio 2010


Crystal Reports for Visual Studio 2010 will be released separately, instead of included with the product.

Follow this link to download Crystal report for Visual Studio 2010, http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp

Click this highlighted link, download and install. 


After finishing the installation you will not see any tool in the tool box. Then go to the “Project Properties” (if you have open new project in C#.net or VB.net) and find the Target Framework, you would see it as .Net Framework 4 Client Profile change this to be .NET Framework 4


Change as .NET Framework 4
 

When you change to .NET Framework 4 confirm it by click Yes

Now you can see Crystal Report Viewer in Tool Box.


Mapping data flows in Azure Data Factory

  Overview: Data flows are one of the features inside the Azure Data Factory which allows data engineers to develop data transformation logi...