TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Griffin Kamotho
NA
117
837
Unable to update records in a table
Sep 21 2017 3:17 AM
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();
}
Reply
Answers (
1
)
I have two arrays in c#
How to store the list of arrays using EF