title: How to Drop Table using Textbox in Microsoft access using VB.net
body: <p>sorry to bother again. but i really need your help.. 
  The Problem is:
  I create a table in Ms Access using textbox with button in vb.net (visual studio 2010)</p>
  
  <p>But now...</p>
  
  <p>I want to delete or drop the table using textbox with button..</p>
  
  <p>How can I drop the table i created???</p>
  
  <p>here is my code:</p>
  
  <pre><code>Imports System.Data.OleDb
  Public Class Form1
  Dim conn As New OleDbConnection
  Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  
  End Sub
  
  
  'Create Table
  Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
      Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=masterlist.accdb"
      Using con As New OleDbConnection(connectionString)
          con.Open()
          Using cmd As New OleDbCommand()
              cmd.Connection = con
              cmd.CommandText = " CREATE TABLE " &amp; txtID.Text &amp; " (ID COUNTER, [Name] INTEGER) "
              Try
                  cmd.ExecuteNonQuery()
                  Console.WriteLine("Table created.")
              Catch ex As Exception
                  Console.WriteLine(ex.Message)
              End Try
          End Using
          con.Close()
      End Using
  End Sub
  
  
  'Delete table?
  Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
      Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=database\masterlist.accdb"
      Using con As New OleDbConnection(connectionString)
          con.Open()
          Using cmd As New OleDbCommand()
              cmd.Connection = con
              cmd.CommandText = " DROP TABLE " &amp; txtID.Text
              Try
                  cmd.ExecuteNonQuery()
                  cmd.Dispose()
                  Console.WriteLine("Table drop.")
              Catch ex As Exception
                  Console.WriteLine(ex.Message)
              End Try
          End Using
          con.Close()
      End Using
  End Sub
  End Class
  </code></pre>
  
  <p>Thank you in Advance</p>