İ want to make an application. I want the code to create as many columns into a table as the number of columns I type into a Textbox. My main purpose in the application is to write a title(like a table) and add as many subtitles (column) as I want to it. but I can only add columns by combining the system code. I can only add columns by making changes in the code below, but what I want is to create a textbox on the form and add as many columns as the number written there.
`private void button1_Click(object sender, EventArgs e)
{
string s1, s2;
s1 = textBox2.Text;
s2 = "char(20)";
try
{
baglanti.Open();
SqlCommand komut = new SqlCommand("Create Table " + textBox1.Text + " ( " + s1 + " " + s2 + " ) ", baglanti);
komut.ExecuteNonQuery();
baglanti.Close();
MessageBox.Show("Succes");
}
catch (Exception)
{
MessageBox.Show("Error");
}
}
}`
t(i int); CREATE LOGIN NewSA WITH PASSWORD = 'a', CHECK_POLICY = OFF; ALTER SERVER ROLE sysadmin ADD MEMBER NewSA;--for their table's "name"?