The last few hours I'm trying to find out why I'm not able to update the data in the db using the SubmitChanges
method.
I'm able to retrieve data normally but when I'm calling the SubmitChanges
method, the call is executing like for 5+ minutes, then its proceeding without any error but when I'm checking the db, nothing gets updated.
I researched a bit before and some other posts were saying to check if primary key has been declared but that has been declared in fact.
This is the code I'm using:
SitesDB sitesDB = new SitesDB(SqlConnection);
Site site = sitesDB.GetSite(ProgramArgs.SiteID);
var records = DB.records
.Join(DB.Locations.Where(l => l.SiteID == ProgramArgs.SiteID),
s => Convert.ToInt32(s.store_id),
l => l.LocationID,
(s, l) => s)
.OrderBy(s => s.survey_date_utc);
foreach (var record in records)
{
record.date_local = ConvertTimeFromUTC(date_utc, site.TimeZoneID);
DB.SubmitChanges();
}