Simple way to Zip files with C# .NET

By | November 28, 2017

In .Net 4.5, there are many new features introduced. One of the new changes is, the improvement in the System.IO.Compression namespace. Now, we can create zip file in a very simple manner. In order to use the new functionality of the Compression namespace, you need to have .Net 4.5 installed. Also, you will need to… Read More »

C# Interview Questions on Abstract Class and Interface

By | September 17, 2017

In this article, we will discuss the frequently asked interview questions on Abstract Keyword and Interface in C#. See the below Questions and answers: Q. Can abstract class have constructors in C#? Ans : Yes, abstract class can have constructor. Q. Can abstract class have static methods in C#? Ans : No, abstract methods cannot… Read More »

How to Hide Stored Procedure’s Code in SQL server?

By | April 2, 2017

WITH ENCRYPTION you can hide the stored procedure’s or function’s code in SQL server. You can hide it with the command WITH ENCRYPTION when you create stored procedure or function.  Example : Let’s create a simple stored procedure. CREATE PROCEDURE SPNAME AS SELECT * from TableName GO Now create the same stored procedure WITH ENCRYPTION… Read More »

DataTable select method with single quote conflict in C#

By | June 24, 2016

I have recently found this error while working on LINQ’s select method. It gave me error when the conditional field contains an apostrophe, it makes my application to throw an exception. My LINQ’s select statement was as below : DataRow[] newDtr = ds.Tables[“TableName”].Select(“Name = ‘” + drData[“Name”].ToString() + “‘”); So, I tried to fix the… Read More »

How to find an event created date on Google Calendar?

By | January 4, 2016

In this I will show you how to find an event created date on google calendar. This is one of those useful bits of info you’ll rarely use but when you need it, it’s important. It’s not easy to find but here’s how… Login to Google Calendar Go to Settings (Calendar Settings) => Click on Calendars… Read More »

How to Calculate Age from a Date of Birth using C#.Net?

By | August 26, 2015

You can calculate age from a given date of birth using below code. DateTime PresentYear = DateTime.Now; TimeSpan ts = PresentYear – DateTime.ParseExact(strDob, "dd-MM-yyyy", GlobalVariables.culture); DateTime Age = DateTime.MinValue.AddDays(ts.Days); Now you can put show the age as below : MessageBox.Show(string.Format(" {0} Years {1} Month {2} Days", Age.Year – 1, Age.Month – 1, Age.Day – 1));

How do you modify the web.config appSettings at runtime?

By | August 17, 2015

The web.config file is the configuration file of a web application. It is typically used to configure an ASP.NET Web application and define the configuration settings for that Web application. It contains the application-wide settings, such as database connection string, culture settings, authentication, and authorization information, etc. In ASP.NET 1.x, much effort was required to… Read More »

How to use Google reCAPTCHA in ASP.Net?

By | December 19, 2014

Background : This article explains the using of Google reCAPTCHA API in ASP.Net website to prevent input from an automated system. Let us learn about it step-by-step.   What is reCAPTCHA? This is a free service from Google that helps to protect websites from spam and abuse that restricts the automated input sent by a… Read More »