I am moving selected data from one listbox to another but I am getting an error "Object reference not set to an instance of an object."
<pre><code>            ListItem item = new ListItem();
            item.Text = ListBox1.SelectedItem.Text;////(error occured here)
            ListBox2.Items.Add(item.Text);
            ListBox1.Items.Remove(item.Text);
            string usrid = null;

            string usridselect = "select user_id from user_membership where email_id ='" + ListBox1.SelectedItem.Text + "'";
            SqlConnection sqcon = DBConnection.connectDB();
            sqcon.Open();

            SqlDataReader sqldr = DBConnection.SelectData(usridselect, sqcon);
            if (sqldr.HasRows)
            {
                while (sqldr.Read())
                {
                    usrid = sqldr[0].ToString();
                }
            }
            sqldr.Close();
</code></pre>
