Hi ,
Check this
private void button1_Click(object sender, EventArgs e)
{
using (SqlConnection con =
new SqlConnection(@"Data Source=IT-DEV2\SQLEXPRESS;Initial Catalog=test;Integrated Security=True"))
{
con.Open();
using (SqlCommand cmd = new SqlCommand("INSERT INTO dbo.cate (cate_id) values (@cate_id )", con))
{
cmd.Parameters.AddWithValue("@cate_id", comboBox1.SelectedValue );
cmd.ExecuteNonQuery();
}
}
}
Best Regards
M.Mitwalli