Lastest snippets

  • Reset Visual Studio Settings

    This little cmd can be used to reset visual studio to its default factory settings.
    Wed, Jan 27 2010 11:47 AM by Sonu Kapoor
  • Function to get the Ordinal Numbers

    Sometimes you would need some function which would give you equivalent ordinal representation for numeric values. This function would give you Ordinal Representation for passed numeric argument.
    Fri, Jan 08 2010 9:19 AM by Kaushal Parik
  • Replace apostophes in javascript using RegEx

    The other day I needed to replace some apostrophes in javascript. We can use standard string.replace("'", "");, however this will replace only the first occurrence, therefore a regex is the best solution.
    Wed, Dec 30 2009 11:00 AM by Sonu Kapoor
  • Concatenate multiple files into single file

    The following code snippet shows how to concatenate multiple files into single file. In this function I am looping through the source file and appending them into the destination file.
    Fri, Dec 18 2009 3:48 AM by Harry L
  • Looping through Folders recursively

    In the following code snippet I am listing out all the sub folders present in the root folder. Here I will pass the root folder path to the GetListOfSubFolders function. Internally this function will call itself recursively to list out all the subfolders present in the root folder in addition to th...
    Tue, Dec 15 2009 4:09 AM by Harry L
  • File information

    In following code snippet I have tried to show the mostly required information from file path. Using Path class we can easily find out the basic information we need from file paths such as File Name, File Extension, File name without exetension, File directory name etc.
    Tue, Dec 15 2009 3:44 AM by Harry L
  • Looping through XML nodes using XML Linq

    Following code snippet shows you how to loop through the xml data using XML Linq.
    Mon, Dec 14 2009 5:23 AM by Harry L
  • Preparing XML using Linq.XDocument

    Always we find need of generating XML data on fly. Using XML Linq it became very easy to prepare xml in runtime. In the following snippet I have shown, how we can create the XML data in runtime using Linq document.
    Mon, Dec 14 2009 3:50 AM by Harry L
  • Converting Numbers to Word in sql server

    This sql function tells you hot to convert numbers to words using T-sql. dbo.NUMBERTOWORDS('2345') will return to you as Two Thousand Three Hundread Fourty Five.
    Fri, Nov 20 2009 6:23 AM by Gulab Chand Tejwani
  • Highlighting Search result in gridview

    Below the code show how to highlight the search result in gridview. When gridview is render that time 'HighlightSearch' is called for each result,which is highlighting the search string. Please feel free to ask any question related to this code or anything about sharepoint/.net. Thanks Happ...
    Thu, Nov 19 2009 12:33 PM by Gulab Chand Tejwani
  • Fixing GridView Header

    Create a CSS file "grid.css" within a folder "css" with a class "grid-header".The css folder is under the root directory Call this CSS File from your page which is contain your grid <link href="../css/grid.css" rel="stylesheet" type="...
    Thu, Nov 19 2009 9:58 AM by Gulab Chand Tejwani
  • Compare two dates without time using C#

    To compare two dates without considering the time you have to use the Date object of the DateTime. Here is a quick example:
    Fri, Oct 09 2009 9:07 AM by Sonu Kapoor
  • Bind Excel file to a GridView in few seconds - the easy way

    There are several ways to bind an excel file to a DataGrid/GridView. You can use ODBC, which I personally don't like at all. Or you can use the Aspose.Cells component. The component is not for free - HOWEVER if you are looking to just import a file, then there are no limitations. The limitations are...
    Tue, Oct 06 2009 12:52 PM by Sonu Kapoor
  • Multiple active resultset-MARS

    Mars should be used in two core scenarios, 1) When using MARS results in cleaner looking code 2) When using Transactions and there is a need to execute in the same isolation level scope Mars comes with a cost in fact there are a lot of hidden costs associated with this feature, costs in the clie...
    Sat, Sep 26 2009 7:22 AM by sushant sahoo
  • How to update an SQL Job

    This little sql can be used to update an job. I use this to reschedule the same job in the case it fails for whatever reason.
    Fri, Sep 11 2009 12:13 PM by Sonu Kapoor
  • How to add a new Calendar item in exchange 2003 using WebDav

    In this function you will see how to add a new calendar item using WebDav. To see how to get the existing items see this link: http://dotnetslackers.com/codesnippets/vb/HowtogetCalendaritemsfromExchange2003usingWebDav.aspx
    Thu, Aug 20 2009 9:01 AM by Sonu Kapoor
  • How to get Calendar items from Exchange 2003 using WebDav

    This is a little function, that I use to retrieve the latest calendar items for a specific date range.
    Thu, Aug 20 2009 8:38 AM by Sonu Kapoor
  • C# file downloading client (simple)

    Simple file downloading client code to download a file from a given URL. It works with .NET framework 2.0 onwards. Regards, Pasan Indeewara
    Wed, Aug 19 2009 10:04 AM by Pasan Indeewara
  • Number To Word Function

    The Function takes integer value as argument and gives Their equivalent words. e.g input :101 output:One Hundred one
    Tue, May 19 2009 8:57 AM by shahid shaikh
  • Sending email using DNS server

    Sometimes sending mails using an SMTP server is not feasible for a project’s requirement. We may want to utilize the MX record of the recipient’s domain name. The following technical tip shows how to send mails using mail servers of recipient’s domain. We will be using Aspose.Network for doing this.
    Wed, Feb 18 2009 9:44 AM by Asposeseo Asposeseo
  • C# Bucket Sort

    A simple and effective algorithm for sorting integers in C#
    Tue, Dec 16 2008 3:19 PM by Armando Pensado
  • Convert an Excel XLS file to PDF

    This technical tip shows how to convert an Excel XLS file to PDF even if it contains any images or charts within it. You will be using Aspose.Cells and Aspose.Pdf libraries for XLS2PDF conversion. Please also make sure to save your Aspose.Pdf XML file on disk, not in a stream because Aspose.Pdf XML ...
    Thu, Dec 04 2008 3:16 PM by Asposeseo Asposeseo
  • C# Echo Server using IOCP

    Asynchronous Echo Server is created using C# and XF.Server API. Network events are processed using I/O completion port.
    Tue, Oct 14 2008 12:43 AM by Roberto C
  • Silverlight DHTML via DOM Bridge

    The simplest way is to have a target addressable text range (any html tag with and id or name set) that we can reference and write into.
    Thu, Sep 25 2008 7:00 PM by David Kelley
  • Silverlight DOM Bridge JavaScript Injection

    For the most part this method, when added to our application object or page class, makes it so we can ‘inject’ ECMA script to our hearts content. This includes code that is executed upon evaluation so we don’t have to call out again to execute some function. There are limits to what you can do (i....
    Thu, Sep 25 2008 6:58 PM by David Kelley