To create new Datatable
To create new Datatable: private DataTable getTable(string client, string shipment, DataTable d) { &...
Select all and Unselect all for ListView
Select all and Unselect all for ListView: private void btnSelect_Click(object sender, EventArgs e) { &nbs...
Useful Functions(2)
MessageBox.showif (MessageBox.Show(null, "Do You Want to Delete :" + LV.Items[i].SubItems[8].Text.Trim() + "' data?", "Alter", MessageBoxButtons.YesNo) == DialogResult.Yes){} MessageBox.Show("Success!...
To get text when ListView or GridView index changed
To get text when ListView or DataGrid index changed: private void LV_SelectedIndexChanged(object sender, EventArgs e)  ...
To add header and data for ListView
To add header and data for ListView: LV.Columns.Clear(); ...
Upload weight
How to get the true weight after goods was placed on a scale? private void Mscom_Initial() { ...
To print label
To print label with the control named AxInterop.MSCommLib,Interop.MSCommLibinitial comm port try &n...
SQLHelper
SQLHelper offers some common function to operate DBusing System.Configuration;using System.Data;using System.Data.SqlClient; public class SQLHelper { &nb...
Useful Functions(1)
How to catch UserName and Version? How to play audio file from special folder? You can benefit from blow code.To get user's IDof current computerusing System.Security.Principal;WindowsPrinci...
Common function of Read-write file
We often read or write a file(.txt, .xls etc.), and we can achieve it through following common class.using System;using System.Collections.Generic;using System.Text;using System.Data;using System.IO;u...
How to send mail automatically
Sometimes, it's convenient to do some tasks through background job. In other words, through Scheduled Tasks. If you really do so, it's difficult to know whether the job executed successfully. However,...
How to get the length of a string
If the length of an English character is 1, and Chinese character is 2, how to get the length of a string including English or Chinese character or both? The following methods may help you.Method 1:i...