hi,
i am trying to update data stored in data base with following code i am able to show data from database but i can not able to update it.
the above code execute well but can not create any change in database.
i am trying to update data stored in data base with following code i am able to show data from database but i can not able to update it.
Code:
int Theme_ID = Convert.ToInt32(textBox1.Text); string Theme_Name = textBox2.Text; SqlCeConnection conn; string connstr = " Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)) + "\\MyFirstDataBase.sdf;";Persist Security Info=False;"; conn = new SqlCeConnection(connstr); conn.Open(); SqlCeCommand cmd = new SqlCeCommand(); cmd.CommandText = "update Theme set Theme_Name=Theme_name where Theme_ID=Theme_ID "; cmd.Connection = conn; cmd.Parameters.AddWithValue("Theme_ID", Theme_ID ); cmd.Parameters.AddWithValue("Theme_Name", Theme_Name); cmd.ExecuteNonQuery(); conn.Close();
the above code execute well but can not create any change in database.
Comment