title: Bind or Pull a DataTable record to a MessageBox Text in C#
body: <p>I am trying to make a messagebox text provide datatable results.  Below is a snippet of code that I have written so far:</p>
  
  <p>String mystring = comboBox1.Text;
              if (mystring.Substring(0, 12) == ("Company Name"))
              {
                  textBox2.Text = mystring.Substring(13);
                  ADOCon.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Name\Desktop\SmallBizDb.mdb";
                  ADOCon.Open();</p>
  
  <pre><code>            OleDbCommandBuilder CBuilder = new OleDbCommandBuilder(DAdapter);
              DAdapter = new OleDbDataAdapter("Select Companies.Company_Name From Companies Where Companies.Company_Name = '" + textBox2.Text + "'", ADOCon);
  
              DAdapter.Fill(DTable);
              MessageBox.Show(DTable.ToString());
              ADOCon.Close();
              ADOCon.Dispose();
          }
          else
  </code></pre>
  
  <p>Basically, if an end user types "Company Name-Company One", for example, I would like a message box to appear stating the datatable (DTable) information, which comes from a sql query.  Currently, I have "messagebox.Show(DTable.ToString());", which does not work.  Also, all other examples I have seen use Row indexes, such as ".Rows[0]", which I cannot use since row numbers are not involved, but rather column names and record names from the sql "where" statement within the data adapter.  </p>
  
  <p>There is a lot fluff here, so my major issue is how to convert my datable results so that they will show up in a message box.</p>
  
  <p>Thank you,</p>
  
  <p>DFM </p>