title: Vb.net check if table exist in DB Mysql without Try Catch
body: <p>Hello i want to find the best way for ask to Mysql if a table exist, i find many examples but all wait a exception with try catch like this</p>
  
  <pre><code>Try
        'do a select COUNT(*)
  Catch ex as Exception
        'return True to indicate table exist
  Finally 
       'clean up
  End try
  </code></pre>
  
  <p>but i think no is a good method, well i repeat i think so, other method is this:</p>
  
  <pre><code>   Using cn As New MySqlConnection(cs)
              Dim restrictions(4) As String
              restrictions(2) = tblName
              Dim dbTbl As DataTable = cn.GetSchema("Tables", restrictions)
              If dbTbl.Rows.Count = 0 Then
                  'Table does not exist
                  Return False
              Else
                  'Table exists
                  Return True
              End If
              cn.Close()
              cn.Dispose()
  </code></pre>
  
  <p>but i have a message reference to an object not set.</p>