Saturday, August 11, 2018

Create Dynamic Table on Data Base


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

ADVANCE 2025

 HTML TABLE SCROLL BAR  <style>      .table-container {             width: 100%;             overflow-x: auto; /* Enables horizontal s...