int index = cb1.SelectedIndex; //combo box int uid=1; SqlCeConnection con = new SqlCeConnection("Data Source="C:\application\application.sdf;Persist Security Info=False;"); con.Open(); SqlCeCommand cm = new SqlCeCommand("UPDATE tbl_user SET u_name=@u_name , u_scl=@u_scl , u_ext=@u_ext WHERE u_id=@u_id"); cm.Parameters.AddWithValue("@u_id", uid); cm.Parameters.AddWithValue("@u_name", txtname.ToString()); cm.Parameters.AddWithValue("@u_scl", txtscl.ToString()); cm.Parameters.AddWithValue("@u_ext",index ); try { int eff = cm.ExecuteNonQuery(); if (eff == 1) { con.Close(); MessageBox.Show("User Added", "Done"); } else { con.Close(); MessageBox.Show("not inserted ", "Error"); } } catch (SqlCeException ex) { MessageBox.Show(ex.ToString()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)