I want to update a field based on a condition
if age <25 then class = 10 else class = 20;
so far I have tried these
cmd = new OleDbCommand("update workClass Set Class = 10 when " + ds.Tables["no"].Rows[i][1] + " < 25 else Set Class = 20 ", con);
cmd.ExecuteNonQuery();
second
cmd = new OleDbCommand("update workClass Set Class = 10 where" + ds.Tables["no"].Rows[i][1] + " < 25 else Set Class = 20 ", con);
cmd.ExecuteNonQuery();
I get this error message
note the ds.tables return 33in the first iteration so that bit works fine
Syntax error (missing operator) in query expression '10 when 33 < 25 else Class = 20'.
ds.Tables["no"].Rows[i][1]return ?