Click here to Skip to main content
15,891,621 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Greeting everyone i'm trying to update table by increases qty from xamrain.form so i'm using markup c#
anyway i try to update but i got error message
Quote:
The name 'x' does not exist in the current context


x mean
Quote:
Where(x.BarcodeST


in this code below

What I have tried:

StocktakingTB stocktaking = db.Table<StocktakingTB>().Where(x.BarcodeST == 1).Select(x => x.QTYST);
stocktaking.QTYST += 1;
db.Update(stocktaking);
Posted
Updated 8-Jul-20 23:18pm

1 solution

The Where method expects a function where the parameter is the object instance. If you compare what you've written in your Select method to this method, you can see that you've forgotten to declare the parameter as x =>

Lambda expressions - C# Programming Guide[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900