Tag Archives: C#

How to add rows and columns to a WPF Grid programmatically

Introduction In this post we will see how to add rows and columns to a Grid in WPF programmatically using code behind. After adding rows and columns to the Grid, we will add some Buttons to it. We will set background of these buttons to random colors using RandomColor class created in my last article… Read More »

How to generate random colors in C#

Introduction In an application I required to generate some random colors. Writing these colors manually was not easy. So I decided to use .NET Reflection to generate colors using System.Drawing.Color class Description We can use GetProperties method of Type class to get all the properties of Color class. It returns an array of PropertyInfo class.… Read More »

Text to Speech using C# in Windows Forms Application

In this post I will explain how to convert text to speech using C# in Windows Forms Application Download Source Code Introduction In this post we will see how to convert text to speech (TTS) using a built in Narrator installed in the system. We will use SpeechSynthesizer class of System.Speech library to built a… Read More »

Create a Geographical Chart (Geo Chart) in ASP.NET from database using Google Chart Tools

In this article I will explain how to create a Geographical Chart in ASP.NET from database using Google Chart Tools Download Source Code Introduction In my last article I discussed about creating a simple Pie Chart in ASP.NET using Google Chart API. In this article we will see how we can create a Geographical Chart… Read More »

How to get class information using .NET Reflection

In this article I will explain how to get properties, methods and events of class using .NET Reflection Download Introduction In this article we will see how to get class or type information of all the types inside System.Windows.Forms assembly. We will list all the properties, methods, and events of the selected class. We will… Read More »

Visual Studio Tips and Tricks: How to rename identifiers using Refactor Rename

Introduction In this post I will explain how to rename all the occurrences of an identifier using Visual Studio tool “Refactor Rename” Description In some situation we need to rename all the occurrences of an identifier like a variable name, a method name, a property, a class name etc. In that situation it is not… Read More »

Connecting to Oracle database from Windows Forms application using C#

Download source code In this article I will explain how to connect to Oracle database from Windows application using C# Introduction In this article I will explain how to connect to Oracle Database 11g Express Edition database from a Windows Forms application using C# and display data from Oracle Database to a DataGridView control. Description… Read More »

Search a folder recursively in a Windows Forms application using C#

Download source code Introduction In this post I will explain how to search a folder recursively for some text and list all the files in the folder and its sub folders containing this text in a Windows Forms application using C# Description Step 1: Create a new Windows Forms application Step 2: Arrange controls on… Read More »

How to edit Master-Detail form using GridView and DetailsView control in ASP.NET

In this article I will explain how to edit master-detail form using GridView and DetailsView control in ASP.NET Download source code Introduction In one of my previous article I explained how to Master-Detail form using GridView and DetailsView in ASP.NET. In this ariticle I will explain how to edit a master/detail form in ASP.NET from… Read More »

How to write data of an SQL Server table to an XML file using C#

Introduction In this article I will discuss how to write data of an SQL server table to an XML file using C# Description I have an Employees table in Northwind database with some sample data that we are going to write in an XML file. You can download Northwind and pubs sample databases from here… Read More »