In Correct Syntax near Int32
foreach (DataColumn dc in dt.Columns) { if (exists == null) { SqlCommand createtable = new SqlCommand("CREATE TABLE " + TextBox1.Text + " (" + TextBox1.Text.Substring(0, 1) + "ID" + " sizeof(Int32) )", con); createtable.ExecuteNonQuery(); exists = dt.TableName; } } SqlCommand addcolumn = new SqlCommand("ALTER TABLE " + TextBox1.Text + " ADD " + TextBox2.Text + " varchar(MAX)," + TextBox3.Text + " varchar(MAX) ," + TextBox4.Text + " varchar(MAX)," + TextBox5.Text + " varchar(MAX)," + TextBox6.Text + " varchar(MAX)," + TextBox7.Text + " varchar(MAX)," + TextBox8.Text + " varchar(MAX)", con); addcolumn.ExecuteNonQuery(); Session["tablename"] = TextBox1.Text.ToString(); break;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)