Click here to Skip to main content
15,912,897 members

Comments by J van Rooyen (Top 4 by date)

J van Rooyen 13-Oct-13 8:05am View    
It's not an error - rather a design concept. I'll get you some code to work with...
J van Rooyen 2-Jul-13 8:43am View    
Stated in Q1: "...and not just "un-setting", or removing a value"

The reason I hava a problem with "un-setting":

As per php.net, the unset() destroys the specified variables. BUT: The behaviour of unset() inside of a function can vary depending on what type of variable you are attempting to destroy.

If a globalized variable is unset() inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset() was called.

Also, I can't seem to find accurate info on unset() on $_POST variables and $_SESSION variables...
J van Rooyen 28-Mar-13 8:50am View    
Well, it's still un answerred. If you look at the view count, and not the date clearly people are experiencing similar problems, and they are looking for the answer. I'm attempting to help more than just the OP... I'm not trying to get ratings, rather, to be helpful.
J van Rooyen 28-Mar-13 6:42am View    
It shouldn't, as long as there are unique identifiers.

Because LINQ needs the Object Model to be selected from the DB, and not cast or created on the fly. In other words, you need to select the object first, like so:

//Use the following code and replace all code in foreach loop
System.Console.WriteLine(updateStatus[0].DefectStatus);
System.Console.WriteLine(updateStatus[0].DefectID);
System.Console.WriteLine(updateStatus[0].MaintenanceID);

//Select a single (and DB bound/linked item)
MaintenanceDefect updateItem = context.MaintenanceDefects.Single(o => o.DefectID == pvalue.DefectID); //May need to parse or cast a few Int's there, depending on your design

//Update a field/property value
updateItem.DefectStatus = "Fixed";

//Update all objects bound/linked to the context
context.SubmitChanges();