I want to create tables in database dynamically i.e at the click event of a button or any other event.
Suggest me HOW ?

Thank You

Below example is in MS SQL...same can be done in Access database just change the SQLCommant to OLEDBCommand

First open the connection and then

Dim myCommand As SqlCommand
myCommand = New SqlCommand("CREATE TABLE Tablename (col1 datatype1,col2 datatype2)", myconn) 'where myconn is the connection object
myCommand.ExecuteNonQuery()

'Keep adding the table names as many as u want
myCommand = New SqlCommand("CREATE TABLE Tablename2 (col1 datatype1,col2 datatype2)", myconn) 'where myconn is the connection object
myCommand.ExecuteNonQuery() 

.
.
.
.

CLose the connection

@poojavb:

In Fact I wanted to add table at the click event of the mouse which will take the table name from the user. And I have solved it.

I Appreciate your help.
Thanks a Lot.

This question has already been answered. Start a new discussion instead.