Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Unable to update records in a table
Griffin Kamotho
Sep 21 2017 3:17 AM
242
Reply
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();
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
I have two arrays in c#
How to store the list of arrays using EF