1
Answer

Unable to update records in a table

Am unable to update records in a table here is the code am using. am able to read the table data but when i update it is not updating. Here is the code.
 
string Conx = @"Data Source=" +
(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)) +
"\\ReaderDB.sdf;Persist Security info=False";
conn =new SqlCeConnection(Conx);
conn.Open();
SqlCeTransaction Trans = conn.BeginTransaction();
try
{
istr = "Update TblLogger set CRead=" + CRead + ",Consumption=" + Consumption + ",Status='" + cboStatus.Text + "' where WSNO='" + cellValue + "'";
comm.Connection = conn;
comm = new SqlCeCommand(istr, conn, Trans);
comm.ExecuteNonQuery();
Trans.Commit();
txtReads.Text = "";
}
catch (Exception)
{
MessageBox.Show("Data not posted").ToString();
}
 

Answers (1)

0
Photo of Manpreet Singh
NA 51.4k 2.4m 10y
Hi Shiny,


Can you tell me which broser are you using?


Cheers !
Manpreet
0
Photo of Shiny Joseph
NA 6 1.4k 10y
Thanks Vithal for the response.
Have tried this but no luck.
Appreciate your help further.

Regards,
Shiny Joseph
0
Photo of Vithal Wadje
NA 47.6k 23.3m 10y
I think its due to windows authentication ,try by opening studio as Run as administrator