Tag: How to

How to Implement Style Inheritance in Windows Phone 8 ?

There are times when you want to apply some styles to a control in Windows Phone 8 but you may not want to start it from scratch . In these scenarios , the developers can use the property “BasedOn” to reference another style that is defined . For example , assume that there is already a style named “Style1” and for the Style2 you might…

ElasticSearch – How to Interact with ElasticSearch using JSON over HTTP ?

Problem Statement You need to communicate with ElasticSearch to perform the search or the CRUD operations. Solution You can interact with ElasticSearch using the RESTful API over port 9200. Additionally , ElasticSearch has the official clients for various programming languages like .NET , Java , Ruby etc. The format of the request of ElasticSearch is as specified below. <VERB> <PROTOCOL> ://<HOST>/<PATH>?<QUERYSTRING> Additionally , it can…

F# Program to display "Hello, World!"

Problem Write a program in F# to display “Hello, World!” on the screen. F# Program to display “Hello, World!” in Console Window. This is a simple F# program that displays “Hello, World!” on the console window. Output Hello, World!

How to Enable JavaScript in Windows Phone 8 WebBrowser Control?

If you are using the WebBrowser control in your Windows Phone project, there are times when you want to enable JavaScript in it to achieve various things. How to Enable JavaScript in Windows Phone 8 WebBrowser Control? This is pretty simple. The WebBrowser Control in Windows Phone SDK has a property IsScriptEnabled, Just set this property to true. <phone:WebBrowser x:Name=”BrowserControl1″ IsScriptEnabled=”True” /> You are done….

How to generate a random number in C# and .NET?

If you want to generate a random number in your .NET application using C#, you can use the random class to generate one. How to generate a random number in C# and .NET? Below is a sample code snippet on how to generate random numbers in C#. Try to keep the instance of the Random class and reuse it Incase you are generating more than…

How to add Items to ListBox control in Xaml ?

You can add the Items to a List Box control in Xaml using the Items property . The Items property is an ItemCollection which implements IList. How to add Items to ListBox control in Xaml ? Below is a sample code snippet demonstrating the adding of the Items to ListBox in Xaml of a Windows 10 UWP App. The above showed how to add items…

How to get all the column names of a table in SQL Server ?

If you have a scenario where you need to get all the column names of a table in SQL Server , you can query the database’s INFORMATION_SCHEMA.Columns table by specifying the table name. How to get all the column names of a table in SQL Server ? Here’s a query to demonstrate how to achieve this. This would display all the columns of the table…

How to apply a Layout for a View in ASP.NET MVC ?

In the previous article , step by step procedure was provided on How to Create Layout in ASP.NET MVC Project ? . This article will explain how to apply a layout to a View in ASP.NET MVC. How to apply a Layout for a View in ASP.NET MVC ? The View has a property called “Layout” . This “Layout” property needs to be set in…

How to read the complete content of the Text File in C#?

Here’s an easy way to read the complete content of the text file in c# with just one line of code. This is achieved using the System.IO.File.ReadAllText function. Below is a sample code snippet demonstrating how to read the complete content of the Text File in C#? The test1.txt contains the file which needs to be displayed. The test1.txt contains the text “Welcome to Abundantcode.com”….

How to Use Split Function in VB.NET?

The Split function in VB.NET (Visual Basic.NET) lets the developers to split the string based on the delimiter and return one – dimensional array that contains the substring. How to Use Split Function in VB.NET? Below is a sample code snippet that demonstrates how to use the Split function in VB.NET. Output of Split Function

How to find the duplicate records on certain fields in SQL Server ?

You can use the group by and having clause in your T-SQL query to find out the duplicate records from the table. How to find the duplicate records on certain fields in SQL Server ? Lets have a look at the query that uses the group by and having clause on the Person table in the AdventureWorks database. The firstname column is used as the…

SQL Server 2014 Tutorial – Assign TCP/IP Port to Database Engine

Problem Statement You need to change the SQL Server 2014 port number from 1433 to a different port number. Solution By default , SQL Server runs on the port number 1433. You can change it to different port number by following the below steps. 1. Open SQL Server 2014 Configuration Manager from the Windows Start menu. 2. In the left side bar of the Sql…

C Program to display Inverted half-pyramid using numbers

Problem Write a program in C to print Inverted half-pyramid using numbers as shown below.The program should take the number of rows as input. 1 2 3 4 1 2 3 1 2 1 How to create and display Inverted half-pyramid pattern in C using numbers ? Output Abundantcode.com Coding samples Enter number of rows: 4 1 2 3 4 1 2 3          1 2           …