Databound Label text displays old data upon save. Re-open record and data is correct?
I have a windows forms application. I have a main form and I have a button on this form to set a "Qualified" date/time stamp. I开发者_运维百科 have a Databound label control that I set the value when the user clicks the button. This date/time stamp is working as far as displaying but when you click the save button it either shows blank or the previous date/time. If you then then close the record and re-open it the new date/time value is displayed so the data is getting to the database it's just not persisting in the dataset as new data?? Not sure why the databinding isn't refreshing the value.
I have noticed this behavior even if I use a textbox, same thing if I do it programatically. If I manually type in a value it persists??
Here is the code I'm using in the click event of my button:
string result = string.Empty;
string jobOrderID = UnitOfWork.MasterDSBS.MJOBO[0].JC_IDNO.ToString();
string timeNow = DateTime.Now.ToString();
//Call Web service to make the update
RadServices.Service1 rsWeb = new RadServices.Service1();
result = rsWeb.SetQualifiedDate(timeNow, jobOrderID );
//Changed the qualified label text.
_btnQualify.Text = "Qualified";
rlQualifiedDate.Text = timeNow;
Have you tried refreshing the control.
精彩评论