Monday, 2 September 2013

Remove all spaces in column data for entire table

Remove all spaces in column data for entire table

below is my simple action, im trying to remove all the spaces in the
machinenames, i thought the below would of done it, but it doesnt do
anything, data stays the same :| anyone have any ideas?
Thanks
var Equipment = db.tblEquipments;
foreach (var Item in Equipment)
{
Item.MachineName.Replace(" ", "");
}
db.SaveChanges();

No comments:

Post a Comment