Posts Tagged ‘C#’

ExportData Table to Excel using C#

// February 15th, 2010 // 5 Comments » // C#, Database, Programming

Here is little class that I wrote some time ago that helps you export data from DataTable into Excell xls file. It format fields in xls file based on data type from data table.

It’s not a perfect but it will help you to quickly save data from Data Table to Excel file.

Example of usage:

Common.Data.Export2Excel(dataTableWithData, "exported.xls");

(more…)

Reset all controls on form (Windows forms – C#)

// December 25th, 2009 // 2 Comments » // C#, Programming, UI, WinForms

Well i had a situation where i need to reset all controls (mostly Textboxes and Comboboxes) on form to their default (entry ready) state. Well, at first sight I was thinking it’s not a problem, my .net Win form have property called Controls – list of all controls on form. But problem was that i had overlapping panels which i used for positioning, and inside of panels was Group box control. So it’s allready complicated then at first sight.

I have created little Form helper which will help you reset all controls on form to their default state.
(more…)