• I'm not sure if I'm understanding you problem correctly, but just iterate throught the items in the ListBox, building a string as you go and then pass that to a stored procedure that accepts that string as a variable and inserts it into the table. If you must store the string as a comma separated value, then I would do this in your .NET application:

    protected void btnSaveSelection_Click(object sender, EventArgs e)

    {

    // Get the corresponding ids for the selected names

    string ids = string.Empty;

    for (int i = 0; i < lstNames.Items.Count; i++)

    {

    // If the name was selected, store in variable

    if (lstNames.Items.Selected)

    {

    ids += (ids == string.Empty) ? lstNames.Items.Value : "," + lstNames.Items.Value;

    }

    }

    // Call stored procedure to insert the concatenated string

    clsDB db = new clsDB();

    db.SaveSelectedNames(ids);

    }

    clsDB is your database class that contains a call to the stored procedure, passing the string of ids. This is just the 10,000 foot perspective. Obviously, you would include some error handling, but you get the idea. Not sure if this is what you're looking for??