C# winforms Code samples

Local network browsing

Defining databases details

Printing reports

Balance sheet

Dynamic reports

Making invoices

Simple register

images/large/setup.png images/large/firme.png images/large/pregled.png images/large/bruto.png images/large/kpir.png images/large/faktura.png images/large/roba.png

Form Description

Setup form with double database connection ability (MySQL and MS Access) and browsing network servers.

Form Description

This is form with CRUD ability, searching records, creating databases in MySQL and MS Access

Form Description

This is a form with multiselect (delete multiple rows) functionality, printing to MS Word and Crytal Report.

Form Description

Balance sheet with the Crystal Reports

Form Description

Very complex dinamic report Form and printing in MS Excell

Form Description

Form for creating invoices

Form Description

Simple register CRUD form

Form details

Get hostnames with System.Net getting hostnames:
strHostName = Dns.GetHostName();
Then using host names, get the IP address list for connection:
IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
IPAddress[] addr = ipEntry.AddressList;
using System.IO; write and read configuration file with connections, servers and databases details.
StreamWriter sw = new StreamWriter("InfoPos.ini"); sw.WriteLine(optMysql.Checked==true ? "MYSQL":"MSACCESS");

Form details

This form shows :
- CRUD abilities with System.Data.Odbc; opening database, searching records,insert, update and delete records with :
Odbc connection strings, datasets, adapters
- binding data to form controls : txtSifraFirme.DataBindings.Add("Text", grid1.DataSource, "sifra", false, DataSourceUpdateMode.OnPropertyChanged);
- Show how to open LookUp forms and Get data from them
- Implementing comboboxes (databinded with table from database) into GridView control and update data directly from GridView control.
- Opening Windows File/Dir. open dialogs and selecting files/dirs :
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(this.txtPutanjaDoBaze.Text);

Form details

This is a form for view and control POS sale receipts with abilities to delete multiple receipts :
foreach (DataRow dr in datatab.Rows){ if (dr["n"].ToString() == "1"){ ...
Printing and reclamation of fiscal receipts (for printers Datecs, Tremol, Mikroelektronika)
Printing data to MS Word templates .dot
( Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();)
and printing data into Crystal Reports
reporti.rptPrintFirmeDSDT myrep1 = new reporti.rptPrintFirmeDSDT();
with manipulation of formula fields, subreports etc...

Form Details

Dynamically created dataset in runtime with large number of rows represented in master/details relation grid
DataRelation relation = new DataRelation("relacija", dss.Tables[cDbTabela].Columns["rb"], dss.Tables["BB"].Columns["rb"], false);
and printing to Crystal Report with special defined demands.

Form Details

Complex form with dynamically created data with the search by date and other criteria. Form also has and dynamically created report in MS Excell.

Form Details

Form for creating invoices with key preview functions (Mouse is not required)
switch (e.KeyCode){
case Keys.Enter:
ProcessTabKey(true);
break; ...
fast barcode recognition, printing fiscal receipts, showing mathematical operations, memory size and position of form

Form Details

Simple register CRUD form with searching records, memory size and position of form, key preview.

KLIKER