Tag: How to
How to Open Network Connections from Command line in Windows 10 ?
You can use the ncpa.cpl command to open the network connections from command line in Windows 10. How to Open Network Connections from Command line in Windows 10 ? Just open the command window and type ncpa.cpl and press the enter key to open the network connections dialog. Alternatively , the ncpa.cpl command can also be used in the Run window. Press Windows + R…
How to Convert a Byte Array to Integer in C# ?
To Convert a Byte array back to the integer , the developers can use the BitConverter.ToInt32 method which accepts byte array as input and returns the number . Below is a sample code snippet that demonstrates how to convert a byte array to integer in C#. How to Convert a Byte Array to Integer in C# ?
How to Delete a File in C# ?
Below is a sample code snippet that demonstrates how to delete a file in C# . How to Delete a File in C# ?
How to Check for Column Name in SqlDataReader object in C# ?
Do you want to check if a column exists in a SqlDataReader instance in C# ?. One of the simplest solution is to navigate to all the fields within the data reader and check the name of the field using the GetName method as shown below. How to Check for Column Name in SqlDataReader object in C# ?
How to Find if the User has tapped on the Screen in Windows Phone 8 App ?
There are times when you want to find out if the user has tapped on the screen to perform some action . For example , you are developing a game and want the user to tap anywhere on the screen to proceed . In these scenario , one can use the Touch.FrameReported event which lets you capture the position on the screen where the user…
C Program to find if a number is odd or even using Conditional Operator
Problem Write a program in C language using the conditional operator to check whether a given number is even or odd. How to check if a Number is Odd or Even in C using conditional operator? An integer that is divisible by 2 is an even number and that is not divisible by 2 is an odd number. Example of even number is 2 ,…
How to check if List is Empty using LINQ in C#?
Below is a sample source code demonstrating the usage Any () and Count () to check if the list is empty in LINQ. How to check if List is Empty using LINQ in C#?
C Program to check if a input number is a prime number or not
Problem Write a program in C to check whether a number is a prime number or not. How to find if a number is a prime number in C ? A Prime Number is a number that is divisible by 1 and by itself. Some of the examples of the prime number are 2 , 3 , 5 etc. Here’s a program in C demonstrating…
How to Send e-mail via SMTP using C# ?
Here’s a sample code to send email via SMTP using C#. How to Send e-mail via SMTP using C# ?
How to get the Windows Phone 8 device resolution?
In Windows Phone 8, the developers can utilize the App.Current.Host.Content.ScaleFactor to get the Windows Phone 8 device resolution. How to get the Windows Phone 8 device resolution? Below is a sample code snippet demonstrating how to retrieve the Windows Phone 8 device resolution. The returning value of the ScaleFactor function is 100, 150, and 160 which refers to the resolutions WVGA, 720P, WXGA respectively.
How to convert string to Boolean using System.Convert in C#?
Below is a sample code snippet demonstrating How to convert string to Boolean using System.Convert function in C#
How to Update Map in Windows Phone 8 Programatically using C#?
The Windows Phone 8 SDK provides the MapUpdaterTask which lets the users to update the region map downloaded earlier which can be used for offline usage. This will launch the Map Settings App which lets the users about the updates to the map (if available). How to Update Map in Windows Phone 8 Programatically using C#? Below is a sample code snippet demonstrating how the…
How to Resize an Bitmap Image in C# ?
Below is a sample code snippet that demonstrates how to resize an Bitmap Image in C#. How to Resize an Bitmap Image in C# ?
C Program to display "Hello, World!"
Problem Write a program in C to display “Hello, World!” on the screen. C Program to display “Hello, World!” in Console Window. In the above example , the #include<stdio.h> is a preprocessor command that informs the compiler to include the stdio.h header file in the program. This header file includes some of the commonly used functions like scanf and printf which are used to read…
Equivalent of IF Statement in SQL Server
There are times when you want to perform conditional checks within a SQL Query in SQL Server . Below is a sample Query that demonstrates how to do it. Equivalent of IF Statement in SQL Server Assume that the Employee table contains a column called “Designation” and we might want to show a value 1 if the designation is SSE else show 0 . You…
How to Get the Battery Level from a Windows Phone 8 device using C#?
The Windows Phone 8 SDK provides the Windows.Phone.Devices.Power.Battery class which can be used to retrieve the battery information of the windows phone. Use the Windows.Phone.Devices.Power.Battery.GetDefault ().RemainingChargePercent property to retrieve the Battery Level from a Windows Phone 8 device programatically using C#. How to Get the Battery Level from a Windows Phone 8 device using C#? Below is a sample code snippet demonstrating the steps used…
C Program to Swap two Numbers
Problem Write a program in C language to swap two numbers using a temporary variable and display the result in the screen. How to Swap two numbers in C using a temporary variable? Output Abundantcode – Swap two numbers using temporary variable Enter First Number: 1 Enter Second Number: 7 FirstNumber = 7.00 SecondNumber = 1.00
How to Declare and Define an Short data type variable in F# ?
How to Declare and Define an Short data type variable in F# ?
VB.NET Program to add two integers
Problem Write a program in VB.NET to add two integers and display the result on the screen. VB.NET Program to add two integers Output Enter the first number : 1 Enter the second number : 2 The sum of two numbers is:3
How to Check if a login exists in SQL Server ?
If you need to check if a login exists in SQL Server , you can use query the master.dbo.syslogins for it. How to Check if a login exists in SQL Server ? Here’s a sample query demonstrating how you can query master.dbo.syslogins to find out if the login exists in SQL Server. This would retreive all the details of the loginid ‘sa’.