DotNet By Ajay — New: ES2025 cheat-sheet is live!

March 27, 2019

How to check which JDK/JRE Version is installed in your system?

Using cmd command:

Open command prompt if you are using Windowds 7/8/10
Open teminal if you are using MAC or Linux

Now type below command to check :

to check your JRE Version : 
java -version

to check your java compiler version if you installed the JDK : 
javac -version

February 12, 2019

Interview Question : How to get a list of SQL Server Agent Jobs in SQL Server ?

Here i am writing  a simple query to find the list of all Jobs currently running on SQL Server. We can write below simple query to find the "sysjobs" on each server.

February 8, 2019

SQL | Distinct Clause

Definition :

In SQL, the DISTINCT keyword is used with the SELECT statement to remove all the duplicate records and fetching only unique records.

September 13, 2018

How would you count occurrences of a char within a string?


In many interviews, i faces a problem with the getting count of occurrences of a char within a string. Mostly i ignored these question and i replied like "Sorry, I don't know &  Sorry, i cannot reply".

Finally, i mind it and write a simple code as below :


using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CharOccuranceInString
{
    class Program
    {
        static void Main(string[] args)
        {
            #region Occurance of char in a string using c#
            
            string source = "abcaadbcdbbcd";
            int countA = 0;
            int countB = 0;
            int countC = 0;
            int countD = 0;
            foreach (char c in source)
            {
                if (c == 'a') countA++;
                if (c == 'b') countB++;
                if (c == 'c') countC++;
                if (c == 'd') countD++;
            }

            Console.WriteLine("Occurance of a=" + countA.ToString() +
                                   "\n Occurance of b=" + countB.ToString() +
                                   "\n Occurance of c=" + countC.ToString() +
                                   "\n Occurance of d=" + countD.ToString());

            Console.ReadKey();
            #endregion

        }
    }
}

March 27, 2018

C# Tutorial : Introduction of C#

1 : Introducing C#

 

What is C#?

------------------------------------------
C#('C Sharp') is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft.

It has been designed to support the key feature of .Net Framwork.
It is a simple efficent, productive and type-safe language.
It is a purely objected-oriented, modern language suitable for developing Web based application.

Features of C#

------------------------------------------
It has numerous strong programming features that make it endearing to a number of programmers worldwide.

The important features of C# as follows −

  • Automatic Garbage Collection
  • Versioning support
  • Strict type-safety
  • Delegates and Events
  • Boxing and Unboxing
  • Web Services
  • Properties to access data members.
  • Boolean Conditions
  • Standard Library
  • Assembly Versioning
  • Properties and Events
  • Easy-to-use Generics
  • Indexers
  • Conditional Compilation
  • Simple Multithreading
  • LINQ and Lambda Expressions
  • Integration with Windows

Characteristics of C#

------------------------------------------
C# is designed for both computing and communications. The key feature are as followes :
  • Simple
  • Consistent
  • Modern
  • Object-oriented
  • Type-safe
  • Versionable
  • Compatible
  • Interoperable and  
  • Flexible