Whenever there is a requirement to edit records by batch in my Microsoft Lightswitch project I would normally make a grid, and from the grid the records get edited. But you can edit the records directly using the DataWorkspace object, see the code below.
Dim dw = Me.Application.CreateDataWorkspace Dim PostedSales = (From s In dw.MyData.Sales Where s.SalesNumber >= Me.SalesNumberStart AndAlso s.SalesNumber <= Me.SalesNumberEnd).Execute For Each PostedSalesItem In PostedSales PostedSalesItem.Posted = "Yes" Next dw.MyData.SaveChanges()
The above code extract a set of record in the Sales table based on a series of Sales Number encoded by the user, then loop through the extracted records and update the Posted property of the table to “Yes”.
If you find this blog helpful, you can make the donation by clicking the Paypal button below.