Archive for the 'C#' Category

Show Long Text Item in ComboBox

Many times in our windows form we need to show data in Combo Box and items in combo box are have same length, so we face a problem that some item in the combo box is not shown fully, and increasing width of then combo might not always the good idea. To avoid above mentioned [...]

List all the Logical Drive in the Computer : Windows Application, C#

Using System.Management name space we can read the all operating system details and we query System_Win32 database in the following example I am trying to read all the logical drives in the computer and list them in a ListBox and select a drive and you can browse all the files in the drive. So lets [...]

Read & Write ListBox Item into File: Windows Application

Normally some projects will have very small requirement of storing data, so going to have database and storing small amount of data into database is not suitable answer, you can go for storing data into XML or txt file, in following example I am trying to read and write Listbox items into txt file. I [...]

Using SMOs, Read Tables Script using C#.NET

SQL Server Management Objects (SMOs) are used manipulate database for DBA activities via an application build by you, you can automate some of the DBA tasks by using SMOs in the application. In this article I am try to explain how we can use SMO to retrieve all the Table listed in Nortwind database and [...]

Search Files in a Directory : Windows Application

Following example I am trying to search files in a directory using a criteria, using DirectoryInfo.GetFiles() method we can search files with Criteria and you can use * to find all files those are starting with the some string. So lets start building example, create a windows forms application and add one label, text box, [...]

Export DataGridView into .csv file

Following example I am trying to save the DataGridView’s Data into .csv file Please create a Windows Application and Add a DataGridView and a button on Form1, to fill the data initially please add following code in Form1_Load Double click on the Button and add following code in Button1_Click, in this code we are reading [...]

Handle Click Event of Eclipse: Windows Application

Normally we don’t have any event for the Drawing objects like circle, eclipse ect., so here I am trying to draw a eclipse using graphics and try to give clicking effect and handing that event. Declare the event handler and delegate to handle the events Initialise the Click Event for eclipse we are drawing in [...]