<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Santhosh N</title>
    <description>The latest articles on DEV Community by Santhosh N (@santhosjery).</description>
    <link>https://dev.to/santhosjery</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F585509%2F0262179a-f2ca-462f-9088-9a22a18d4872.jpeg</url>
      <title>DEV Community: Santhosh N</title>
      <link>https://dev.to/santhosjery</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/santhosjery"/>
    <language>en</language>
    <item>
      <title>HttpUtility encode vs WebUtility encode</title>
      <dc:creator>Santhosh N</dc:creator>
      <pubDate>Mon, 14 Jun 2021 11:23:48 +0000</pubDate>
      <link>https://dev.to/santhosjery/httputility-encode-vs-webutility-encode-34e7</link>
      <guid>https://dev.to/santhosjery/httputility-encode-vs-webutility-encode-34e7</guid>
      <description>&lt;p&gt;Hello guys, Today I have learned a difference between HttpUtility.HtmlEncode and WebUtility.HtmlEncode. If you use dot net version less than 4.7 then HttpUtility.HtmlEncode encodes the regional languages. If you want to only html tags need to encode then use WebUtility.HtmlEncode.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var regionalText = "தமிழ்";
        var htmlText = "&amp;lt;script&amp;gt;alert('OK')";

        var httpUtilityRegionalText = HttpUtility.HtmlEncode(regionalText); //&amp;amp;#2980;&amp;amp;#2990;&amp;amp;#3007;&amp;amp;#2996;&amp;amp;#3021;
        var httpUtilityHtmlText = HttpUtility.HtmlEncode(htmlText); //&amp;amp;lt;script&amp;amp;gt;alert(&amp;amp;#39;OK&amp;amp;#39;)

        regionalText = "தமிழ்";
        htmlText = "&amp;lt;script&amp;gt;alert('OK')";

        var webUtilityRegionalText = WebUtility.HtmlEncode(regionalText); //தமிழ்
        var webUtilityHtmlText = WebUtility.HtmlEncode(htmlText); //&amp;amp;lt;script&amp;amp;gt;alert(&amp;amp;#39;OK&amp;amp;#39;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>csharp</category>
      <category>asp</category>
      <category>aspnet</category>
      <category>webapi</category>
    </item>
    <item>
      <title>SQL: Calculate Bussiness Days</title>
      <dc:creator>Santhosh N</dc:creator>
      <pubDate>Wed, 24 Feb 2021 13:16:20 +0000</pubDate>
      <link>https://dev.to/santhosjery/sql-calculate-bussiness-days-4h5h</link>
      <guid>https://dev.to/santhosjery/sql-calculate-bussiness-days-4h5h</guid>
      <description>&lt;p&gt;In this example I'm going to give the query to find the business days between two days.&lt;/p&gt;

&lt;p&gt;Use this function to calculate the number of business days excluding Saturday and Sunday. Also it will exclude start date and it will include end date.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go
-- Select [dbo].[CalculateBussinessDays]  ('02/18/2021', '03/06/2021')
CREATE or ALTER FUNCTION [dbo].[CalculateBussinessDays] ( 
    @StartDate DATETIME,
    @EndDate  DATETIME 
)
returns INT AS
BEGIN
  DECLARE @tempStartDate     DATETIME= @StartDate;
  DECLARE @tempEndDate       DATETIME = @EndDate;

  IF(@tempStartDate IS NULL
  OR
  @tempEndDate IS NULL)
  BEGIN
    RETURN NULL;
  END
  --To avoid negative values reverse the date if StartDate is grater than EndDate
  IF(@StartDate &amp;gt; @EndDate)
  BEGIN
    SET @StartDate = @tempEndDate;
    SET @EndDate = @tempStartDate;
  END

  DECLARE @Counter           INT = Datediff(day,@StartDate ,@EndDate);
  DECLARE @TempCounter       INT = 0;
  DECLARE @TotalBusinessDays INT = 0;

  WHILE @Counter &amp;gt;= 0
  BEGIN
    IF(@TempCounter &amp;gt; 0 OR @Counter = 1) -- To ignore first day's calculation
    Begin
        SET @TotalBusinessDays = @TotalBusinessDays 
                                        + (Iif(Datename(dw, Dateadd(day,@TempCounter,@StartDate)) 
                                            IN('Monday', 'Tuesday','Wednesday','Thursday','Friday'),1,0))
    END

    SET @Counter = @Counter - 1
    SET @TempCounter = @TempCounter +1
  END
  RETURN @TotalBusinessDays;
END



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlserver</category>
      <category>mysql</category>
    </item>
  </channel>
</rss>
