I am developing a C# application with a .sdf database, I have SELECTs, UPDATEs and INSERTs, and all they work while I'm compiling the application.
I mean, I add, delete and modify records, and it works okay i can play with all my information while the app is running. BUT if I close the app and after it, I run it again, all the data is like in the begining, there's not any change in my DB.sdf
It looks like if all my changes were on the RAM memory or something like that...
This is my UPDATE code:
SqlCeConnection connDisp = new SqlCeConnection();
connDisp.ConnectionString = ("Data Source =" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)) + "\\ACB.sdf;Password=acaf;Persist Security Info=False;");
try
{
connDisp.Open();
StringBuilder query = new StringBuilder();
SqlCeCommand comm = new SqlCeCommand();
query.Append("UPDATE ACCT SET NPL ='0004',MODO='M' WHERE NUVO='00003' AND NUIA= '01' AND NUPO= '00700' AND SMCT='000' ");
comm.CommandText = Convert.ToString(query);
comm.Connection = connDisp;
comm.ExecuteNonQuery();
comm.Dispose();
this.Refresh();
connDisp.Close();
}
catch (SqlCeException exce)
{
MessageBox.Show("Exception: "+exce.Message);
}
**Any idea about Why I can't write on my .sdf database?**
I've visited lots of blogs but anyone helped me.
Is it wrong if I ask for a demo mobile app?
Hope somebody help me
Thank You..