I have written code like this, it stores the listbox items for particular user, but it is updating the items in listbox.Like when i select 2 items....for eg: privacy, php its showing only php....i.e the current selected item....
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);
SqlCommand cmd = conn.CreateCommand();
foreach(ListItem item in ListBoxadditems.Items)
{
conn.Open();
cmd.CommandText ="UPDATE UserData SET Interests='"+item.Text+"' WHERE UserName='"+Session["New1"]+"'";
cmd.ExecuteNonQuery();
Label5.Text = "Data Inserted";
conn.Close();
}