Hi, I have one window form with one textbox1 and button1, Here I m adding new column to the Table Employee, and The column name should be the textbox.text name.
private void button1_Click(object sender, EventArgs e)
{
string strConn = @"Password=Admin123;Persist Security Info=True;User ID=sa;Initial Catalog=Employee;Data Source=NAVUY-24B";
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
SqlCommand sqlCmd = new SqlCommand("alter table Employee ADD '" + textBox1.Text + "' varchar(50)", conn);
sqlCmd.ExecuteNonQuery();
}
its not working
Incorrect syntax near at textbox......
pls any one help me...
thanks in advance