Category Archives:

  • How to manage assembly version numbers in .NET using CUSTOM MS BUILD TASKS?

    Posted on March 15, 2012 by in C#, Dotnet

    Every .NET assembly is identified by a version number. It is stored in its manifest along with assembly name, public key and other dependency information. This information is used to enforce policy restrictions and to differentiate it from other assemblies. Version information is stored in AssemblyInfo.cs file in the following format.

  • How to share objects (types) between multiple Web Services

    Posted on March 14, 2012 by in C#, Dotnet

    More than often you would consume services which share objects. Once you add them as “Web References” to your client project, it loses the context and you would end up having multiple copies of the same object under different namespace.

    Scenario

    1) Create a new ASP.NET WEB SERVICE APPLICATION.
    2) Create two web services Service1. asmx & Service2.asmx
    3) Create a shared class Department.
    4) Create a web method RetrieveDepartment in Service1. asmx
    5) Create another webmethod ModifyDepartment in Service2.asmx which uses the same department
    6) Create a simple ConsoleApplication and add web references to above 2 services.

    Post Tagged with ,
  • How to do custom username assertion in WSE 3.0.

    Posted on March 14, 2012 by in C#, Dotnet

    This article would describe how to write a custom username assertion in WSE 3.0. It is nothing but sending username/password from client to service and service authenticating the same before honoring the request. Article would also describe how to sign & encrypt the SOAP header/body without a fuss. We would extend one or more of the “TurnKey security assertions” provided WSE. Turnkey assertions are nothing but set of security operations packaged by WSE.
    Essentially there are four pipelines in WSE 3.0. We need to inject our custom policy assertions into these pipelines. As simple as that
    1) Sender’s Output Pipe Line :
    2) Sender’s Input Pipe Line :
    3) Receiver’s Input Pipe Line
    4) Receivers Output Pipe Line.

    Post Tagged with ,
  • How to remove duplicate rows from SQL Server table

    Posted on March 13, 2012 by in Database, SQL Server

    By design a table shouldn’t contain duplicate rows. However sometimes under peculiar cases a table may end up having duplicate rows. In some cases we might have to disable constraints while loading large amounts of data into a table for performance reasons. You woule get errors if you try to enable constraints after loading. This is a common problem in almost all the enterprises, small & big. We could get rid of these rows in most cases. In this article I would discuss some scenarios & solutions.

    Post Tagged with ,
  • How to convert a Microsoft word document to PDF in VB.NET

    Posted on March 13, 2012 by in Dotnet, VB.NET

    In enterprise environments, PDF is the common used format to share documents between employees. There are so many third party tools that would provide you a way to convert word documents to PDF. But there are no free tools that would provide this functionality.

    In some cases you might have do this conversion programmatically. For example, what if you want some authorized user to make modifications to a document stored in sharepoint and on save you want to distribute the document to people on the network where everyone who doesn’t have MS word on their machines can view?

    Post Tagged with , , ,
  • How to load the XML into a table using OPENQUERY BULK INSERT

    Posted on March 13, 2012 by in Database, SQL Server

    In order to bulk import xml data from a file, you have to apply SINGLE_BLOB option. It makes sure that the xml parser imports the data as per the encoding scheme specified in the XML declaration.
    You could also use table hints such as TABLOCK, you could also use specialized table hints such as IGNORE_CONSTRAINTS, IGNORE_TRIGGERS, KEEPDEFAULTS and KEEPIDENTITY.

    Post Tagged with , , ,
  • How to write custom ADO.NET APPENDER for LOG4NET

    Posted on March 12, 2012 by in C#, Dotnet

    Log4NET is the best thing out there to write data to variety of targets. It provides so many ways to leverage existing framework to customize to your needs. This article describes how to write a custom ADO.NET APPENDER for LOG4NET.

    Post Tagged with ,
  • Shallow Cloning and Deep Cloning of object in C#

    Posted on March 12, 2012 by in C#, Dotnet

    This article explains Shallow Cloning and Deep Cloning of object in C# with examples. Sometimes cloning an object sounds like a simple thing but you have to keep so many things in perspective. Consider this scenario. You have retrieved an object by calling an external web service which is a quite expensive call. That object […]

    Post Tagged with , , ,
Page 49 of 49« First...102030...4546474849