title: How can I get fields from a selected table from a SQL Server 2014 database?
body: <p>This is my code: </p>
  
  <pre><code>namespace Modulul_3_proiect
  {
      public partial class FormSimpleWizard : Form
      {
          public FormSimpleWizard()
          {
              InitializeComponent();
              incarcaComboBoxSimpleWiz(comboBoxWS);
          }
  
          //method to extract tables from BD
          public IList&lt;string&gt; ListTables()
           {
              DBConnection db = DBConnection.getConexiune;
              SqlConnection conexiune = db.conn;
  
              List&lt;string&gt; tables = new List&lt;string&gt;();
              DataTable dt = conexiune.GetSchema("Tables");
              foreach (DataRow row in dt.Rows)
              {
                  string tablename = (string)row[2];
                  tables.Add(tablename);
              }
              return tables;
          }
          //method to load combobox with tables
          private void incarcaComboBoxSimpleWiz(ComboBox cb)
          {
              IList&lt;string&gt; tabeleWizard=ListTables();
              cb.Items.Clear();
              cb.Items.Add("Select tables");
              foreach (String tip in tabeleWizard)
                  cb.Items.Add(tip);
              cb.SelectedIndex = 0;
          }
      }
  }
  </code></pre>
  
  <p>After I loaded the combobox with the tables from my SQL Server database, I want to get the fields of the selected table in the combobox and show them in a textbox multiline so I can make a query after.  </p>