draw dynamically listboxes
<p>i want to draw listbox dynamically, either 1 or 1000 on the form in C#. What should I do?
i am taking data from sql server and filling in the listboxes.</p>

<pre><code>da = new SqlDataAdapter();
            dt = new DataTable();
            da.SelectCommand = new SqlCommand("select column_name from information_schema.columns where table_name='"+listBox1.SelectedItem+"'", myCon);
            da.Fill(dt);
            int x = dt.Rows.Count;
            listBox2.Items.Clear();
            listBox2.Items.Add(listBox1.SelectedItem);
            for (int i = 0; i &lt; x;i++ )
                listBox2.Items.Add(Convert.ToString(dt.Rows[i][0]));
            myCon.Close();
</code></pre>

<p>with the help of this code i statically draw the list box ,but i want to draw them dynamically</p>
