Create Dynamic Table on Data Base
protected void Button1_Click(object sender, EventArgs e)
{
string tbl = "demoTbl";
con = new SqlConnection(conStr);
string cmdStr = "create table " + TextBox1.Text.Trim() + "(" + TextBox2.Text.Trim() + " " + TextBox3.Text.Trim() + "(" + TextBox4.Text.Trim() + ")," + TextBox5.Text.Trim() + " " + TextBox6.Text.Trim() + "(" + TextBox4.Text.Trim() + "))";
cmd = new SqlCommand(cmdStr, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
No comments:
Post a Comment