Author: cgilbu | Posted on: 8/29/2008 10:53:21 AM | Views : 411

I am using an array containing numbers from ListBox1, seperated by comma, to set witch id's to be updated in the sql query. But I am getting this error message: "Conversion failed when converting the varchar value '9,8,7,6,' to data type int". How can I solve this? Thanks for any help!
private void ChangeCountries()
{
StringBuilder str = new StringBuilder();
foreach (ListItem li in ListBox1.Items)
{
if (li.Selected)
{
str.Append(li.Value + ",");
}
}

using (CountriesDataContext db = new CountriesDataContext())
{
db.ExecuteCommand(& ...

Go to the complete details ...