File Handling in PHP

Practically, we use a database to store a relatively larger amount of data on a web server. But sometimes it can be easier and more convenient to directly access files on the storage. Especially when you are dealing with a small amount of data or non-textual data like images, videos, log files, CSV files etc.... » read more

Introduction to Stack in C#

When it comes to data structures, one of the frequently used data structure is Stack. It represents Last in First out (LIFO) concept. Just to give a brief idea about the LIFO, it is a concept that used to remove last elements that added to stack first. Meanwhile, it is not possible to remove elements... » read more

CRUD Operations in PHP/ MySQL

Do you need to make a dynamic website? Well, there can’t be any dynamic website without CRUD operations. CRUD stands for create, retrieve, update and delete. So if you are inserting, displaying, updating or deleting information from website database, you are using CRUD operations. In this article, we are going to learn CRUD operations with PHP... » read more

Overview of dependency injection in C#

Dependency Injection (DI) could be a software system style pattern. It permits us to develop loosely-coupled code. The intent of Dependency Injection is to create code rectifiable. Dependency Injection helps to cut back the tight coupling among software system elements. (DI) reduces the hard-coded dependencies among your categories by injecting those dependencies at run time... » read more

Bind Countries to a DropDownList in ASP.NET using C#

This tutorial will teach you how to create an ASP DropDownList that contains all countries using C#.  A country dropDownList can be used in many ways, such as when requiring information from the user when registering to your website or subscribing to a newsletter. Create countries DropDownList in ASP.NET First, add the System.Globalization namespace to your... » read more

Exception Handling in C#

An exception is a problem that arises during program execution. Exceptions are expected to happen within the code of an application for many reasons (known or unknown). Below is a tutorial on how exceptions work in C#. Exception Handling in C# Exception handling is a feature in C# to handle (exceptional circumstances) runtime errors in... » read more

Delete checked items from CheckedListBox in C#

Below is a sample code that will delete checked items from a ChekcedListBox in a windows form applications. Simply call the code from a button or any other controls of your choice. for (int i = clb.Items.Count - 1; i >= 0; i--) { // clb is the name of the CheckedListBox control if (clb.GetItemChecked(i)) { clb.Items.Remove(clb.Items[i]);... » read more

Functional Programming in C++

We all know C++ as Object Oriented Programming language but just like many other widely used object-oriented languages (Java, C# etc), C++ is slowly adopting more features related to functional languages. Its default behavior is imperative but you can write code in a functional style in C++ even more easily than other pure imperative languages... » read more

How to reverse an Array in C

An array is a variable that can hold multiple values of the same data type simultaneously. Arrays are built into the core of both C and C++. It is useful when you have to declare many variables. Instead of declaring individual variables such as a0, a1, a2, … a99, you declare one array variable such... » read more

Create a Logoff/Logout Action in ASP.NET MVC

In some web environments, closing the web browser will not abandon the current user session. It’s important to create an appropriate logout/logoff action for your application for better security and privacy, especially for users that use in computers and devices. Below is the “Action” method that can be used inside your controller to kill the logged in... » read more

Replace hostname in URL using C#

Below is a function that replaces the hostname in a URL in C#. I take 2 arguments, the old and new host then returns the new host that can be pinged and browsed: public static string ReplaceHost(string originalHost, string newHost) { UriBuilder _builder = new UriBuilder(originalHost); _builder.Host = new Uri(newHost).Host; return _builder.ToString(); } Now call... » read more

Introduction to DataAdapter in .NET

What is data provider? Data Providers is a software library in .NET consisting of classes that let you connect to a data source, execute commands to access and fetch data from a data source with support to execute commands within transactions. Example of a data provider in .NET Framework is ADO.NET Data Provider. Components of... » read more