Error with  selected item from the ListBox property (C#)?
<pre><code>for (int counter = 0; counter &lt; countSelected; counter++)
        {
            string groupName = txt_GroupName.Text;
            //Get GroupID from the created group
            string GroupIDQueryText = "SELECT GroupID FROM tbl_group WHERE GroupName ";
            int groupID = Convert.ToInt32(server.performQuery(GroupIDQueryText, groupName, MySqlDbType.VarChar));
            //To get User ID
            string firstName = ListBoxMembers.SelectedItems[counter].Value;
       }
</code></pre>

<p>This isn't returning the selected value, but instead returns the 1st person in the list even if I haven't selected it. Where am I going wrong?
System.Web.UI.WebControls does not contain defenition for listboxmembers.selectedItems error </p>
