First, I would question why you want to create SQL tables via entry into a Textbox. Something seems wrong there.
But if you must ... this should work:
string sql = "If not exists (select name from sysobjects where name =
'" + txtTableName.Text + "') CREATE TABLE '" + txtTableName.Text + "'(ID int IDENTITY(1,1),
ColumnName varchar(255))";
using (SqlCommand command = new SqlCommand(sql, con)) {
command.ExecuteNonQuery(); }
Untested, and this doesn't account for errors that will occur based on what the user enters into the textbox, such as the single-quote (') character among others.
I would also suggest to just create a stored procedure that accepts a @tableName parameter and then executes direct SQL on the server side to handle this.