Merge data in sql server without merge statement (supports major version of sql server)

This article is basically for whom who cannot use merge statement of sql server (because they are still stuck with the old sql server which no longer supports merge statement) or who are aware of the performance of the merge statement.

JQuery Controls with knockout making custom handlers

Here i am going to explain how to use jquery or any client side framework control with knockout.
as i have already explained how knockout hanlder works and how to create them in my last article.

Dynamic data type in WCF services (Using KnownType Attribute)

Here i am going to explain how to return dynamic or runtime data type from WCF services,
In WCF you find a attribute named KnowType, this attribute is for telling the service that what is the possible return type of the method so thatWCF create a proxy of these types in refrence.cs file.

How to Use :-

Creating Custom binding handler in knockout and how it works

Custom helper is very useful in knockout it is suggested to make custom helpers for implementing any custom knockout functionality and sometime it is required to do so like when you are using templates in knockout as we know templates render later than jquery code after knockout apply binding call. So with the common jquery code we can’t access the element which declares inside the templates.

Generate PDF from html, webpage using pechkin in c#

As i have discussed in my last post Generate PDF, screenshot of a webpage in c# using phantomjs that i found two best solution for generating pdf from html or from a webpage and i already discussed one solution i.e phantomjs now here i will explain the another one that is pechkin.

Generate PDF, screenshot of a webpage in c# using phantomjs

In this post i will explain how to capture screenshot and how to create PDF of a webpage using Phantomjs.

Merging multiple PDFs using iTextSharp in c#

In this article i will show you how to merge multiple pdfs into one using ITextSharp below is the two approach one is to pass your input files path, output file path (will be created if not exist) and another is pass direct input stream, output stream and it will write the merge files into output stream.

image resizing in c# dynamically

In this article you can find the code that is for re-sizing images with given width and height and retain the quality of the image as it was.

below is the function just pass new width, new height and original image file path it will save resize given image and save it into the folder named newsizeimages and returns the new path.

Resize Image Code C#

public string CreateThumbnail(int maxWidth, int maxHeight, string path)

    var image = System.Drawing.Image.FromFile(path);
    var ratioX = (double)maxWidth / image.Width;
    var ratioY = (double)maxHeight / image.Height;
    var ratio = Math.Min(ratioX, ratioY);
    var newWidth = (int)(image.Width * ratio);
    var newHeight = (int)(image.Height * ratio);
    var newImage = new Bitmap(newWidth, newHeight);
    Graphics thumbGraph = Graphics.FromImage(newImage);

    thumbGraph.CompositingQuality = CompositingQuality.HighQuality;
    thumbGraph.SmoothingMode = SmoothingMode.HighQuality;
    //thumbGraph.InterpolationMode = InterpolationMode.HighQualityBicubic;

    thumbGraph.DrawImage(image, 0, 0, newWidth, newHeight);

    string fileRelativePath = "newsizeimages/" + maxWidth + Path.GetFileName(path);
    newImage.Save(Server.MapPath(fileRelativePath), newImage.RawFormat);
    return fileRelativePath;


In if you want to resize client uploaded image files directly when client uploading their image files then you have to save this files first into the server and then pass this file path into the above function as given below example.
if (updImage.HasFile)
   updImage.SaveAs(Server.MapPath("uploadedimage/" + updImage.FileName));

   imgCustomTo8.ImageUrl = CreateThumbnail(8, 8, Server.MapPath("uploadedimage/" + updImage.FileName));
   imgCustomTo16.ImageUrl = CreateThumbnail(16, 16, Server.MapPath("uploadedimage/" + updImage.FileName));
   imgCustomTo24.ImageUrl = CreateThumbnail(24, 24, Server.MapPath("uploadedimage/" + updImage.FileName));
   imgCustomTo32.ImageUrl = CreateThumbnail(32, 32, Server.MapPath("uploadedimage/" + updImage.FileName));


Download image re-sizing sample code click here. charting controls microsoft (ms chart) Line chart samples / tutorial

If you are thinking of charting, graph and reporting then MS Chart is one of the best and easy way to display your data.
By default ms chart include with visual studio 2010 and 2012 (.net framework 4.0, 4.5 or later), you can also use it with visual studio 2008 by installing ms chart component from Microsoft website.

what is access modifier in c#

Access modifiers (or access specifiers) are keywords in object-oriented languages that set the accessibility of classes, methods, member function, member variables etc. Access modifiers are a specific part of programming language syntax used to facilitate the encapsulation of components, It defines the accessibility of the specific type (e.g class, struct), data member etc.

Recent Article