I need help in C# database programming. i need to save textbox text into table of c#
Here is code
Code:
// create command
SqlConnection conn = new SqlConnection(@"server = .\sqlexpress;integrated security = true;database = office");
conn.Open();
string query = @"insert into emp('"+txtid.Text+"','"+txtname.Text+"','"+txtdesig.Text+"','"+txtsal.Text+"','"+txtjoin.Text+"','"+txtadd.Text+"','"+txtjoin.Text+"','"+txtcont.Text+"');";
SqlCommand cmd = new SqlCommand(query, conn);
cmd.ExecuteNonQuery();
conn.Close();
but when i execute this always Getting Error: as incorrrect Syntex.
Any Help suggestion
