I have a problem with saving data to database named Settings.sdf. I have few files:
- Settings.sdf
- SettingsDataSet.xsd
- SettingsDataSet.Designer.cs
- SettingsDataSet.xsc
- SettingsDataSet.xss
If I tried use UPDATE or INSERT INTO queries I would not update my database (Settings.sdf), only change data in cache file (whatever and wherever it is). I'm using correctly all SqlCeCommands. For example:
string conString = "Data Source=Settings.sdf";
con = new SqlCeConnection(conString);
con.Open();
...
using (SqlCeCommand com = new SqlCeCommand("UPDATE Settings SET [Value] = (@loc) WHERE [Key] = 'Location'", con))
{
com.Parameters.AddWithValue("@loc", device.Location);
com.ExecuteNonQuery();
}
...
con.Close();
How manage this problem? Why this command doesn't update directly my database?