Hi,
Please use following code for trimming comma:
string strSelected = string.Empty;
foreach (ListItem item in ListBox1.Items)
{
if (item.Selected)
{
strSelected += item.Text + ",";
}
strSelected = strSelected.TrimEnd(',');
}
com2.Parameters["@ListBox1"].Value = strSelected;