Hai Sir,
In my database I have a table with columns col1,col2,col3.
I want to give the fourth column i.e..,col4 from the front end(when I click add column button in my front end).
Now the updated table should be like col1,col2,col3,col4 after altering the fourth column.
Is it possible to alter a column from Frontend? If possible what is the stored procedure/query for that?


Sabyasachi MishraRank #889 · 2.4K reputationPosted May 26, 2015, 5:05 AM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted May 26, 2015, 7:54 PM EDT
string Str;
Str = "Alter Table Emp Add " + textBox1.Text + " " + textBox2.Text + "";
SqlCommand Com = new SqlCommand( Str,Con);
Com.ExecuteNonQuery();
Con.Close();