Monthly Archives: June 2018

Ternary operator in C#

By | June 13, 2018

Ternary Operator:  ” ?: ” Ternary operator means simple if else condition in one statement based on condition. we can say this is dicision making operator. Syntax: var output = Boolean expression ? first value : second value It three parts, First part (before ?) includes conditional expression that returns boolean value true or false. Second part (after ? and before ‘:’… Read More »

How to uninstall a Windows service if the files of that windows services are deleted

By | June 11, 2018

How to uninstall a Windows service if the files do not exist anymore? Method 1 – We can use the SC tool (Sc.exe) Open a Command Prompt using windows + R and write Syntax: SC Delete <Service-name-which-you-want-to-delete> Example: we wanted to delete “ABC” service, DESCRIPTION: SC is a command line program used for communicating with the NT Service… Read More »

How to check if a column exists in a SQL Server table

By | June 11, 2018

How to check if a column exists in a SQL Server table, Syntax: IF EXISTS(SELECT 1 FROM sys.columns WHERE Name = N’columnName’ AND Object_ID = Object_ID(N’schemaName.tableName’)) BEGIN — Column is exists in DB END Example: Let’s Check wether address column is present in Employee table or not. IF EXISTS(SELECT 1 FROM sys.columns WHERE Name =… Read More »