title: Get The DataBase Table Name in C#
body: <p>Alright, I know that this case has been discussed all over the web, but I still don't understand.</p>
  
  <p>Here's my search result so far:</p>
  
  <pre><code>"SELECT table_name AS Name FROM INFORMATION_SCHEMA.Tables WHERE TABLE_TYPE = 'BASE TABLE'";
  </code></pre>
  
  <p>In this SQL code, I thought that the <code>INFORMATION_SCHEMA</code> was a database name and when I executed the code (of course with the connected database name), an exception was thrown saying that the database name doesn't exist.</p>
  
  <p><strong>Updated:</strong></p>
  
  <p>When I run the SQL query and execute it with:</p>
  
  <pre><code>OleDbDataReader reader = cmd.ExecuteReader();
  </code></pre>
  
  <p>It says: <code>Could not find: path/INFORMATION_SCHEMA.mdb;</code></p>
  
  <p>The things I already done and they're good are:</p>
  
  <ol>
  <li>The connection string is filled with the database name.</li>
  <li>I can do the usual SQL CommandText to my database.</li>
  <li>I'm using the OLEDB DBMS. </li>
  </ol>
  
  <p><strong>SOLVED</strong></p>
  
  <p>And my final code with help of other people is:</p>
  
  <pre><code>DataTable MySchemaTable = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
  new Object[] { null, null, null, "TABLE" });
  
  for (int i = 0; i &lt; MySchemaTable.Rows.Count; i++) {
  combobox1.Items.Add(MySchemaTable.Rows[i].ItemArray[2].ToString()); }
  </code></pre>
  
  <p>Another search is this:</p>
  
  <pre><code>`DataTable T = con.GetSchema("Tables");`
  </code></pre>
  
  <p>And when I print out the <code>t.ToString();</code>, it's only showwing the Tables.</p>
  
  <p>And many more searches.</p>
  
  <p><strong>CASE CLOSED!</strong></p>