Hy all,
I have the following problem with an update in my sdf database.I want to update a table data using a sqlceresultset.This is the code that I'm using but nothing happens.
connection.Open();
string sql="SELECT * FROM Table1";
SqlCeCommand cmd = new SqlCeCommand(sql,connection);
cmd.CommandType = CommandType.Text;
SqlCeResultSet rs= cmd.ExecuteResultSet(ResultSetOptions.Updatable|ResultSetOptions.Scrollable);
IEnumerator enumerator = rs.GetEnumerator();
bool found = enumerator.MoveNext();
SqlCeUpdatableRecord record;
if (found)
{
record = (SqlCeUpdatableRecord)enumerator.Current;
record.SetString(0, cui);
record.SetString(14, cod_asis);
record.SetString(1, denumire);
record.SetString(2, regCom);
record.SetString(3, adresa);
record.SetString(4, fax);
record.SetString(5, tel);
record.SetString(6, judet);
record.SetString(7, codPostal);
record.SetString(8, dataS);
record.SetString(10, tva);
record.SetString(11, platitorTVA);
record.SetString(12, "DA");
record.SetString(13, "DA");
rs.Update();
}
else
{
record = rs.CreateRecord();
record.SetString(0, cui);
record.SetString(14, cod_asis);
record.SetString(1, denumire);
record.SetString(2, regCom);
record.SetString(3, adresa);
record.SetString(4, fax);
record.SetString(5, tel);
record.SetString(6, judet);
record.SetString(7, codPostal);
record.SetString(8, dataS);
record.SetString(10, tva);
record.SetString(11, platitorTVA);
record.SetString(12, "DA");
record.SetString(13, "DA");
rs.Insert(record);
}
I need your help guys.Please:)