Hi!
I need to understand one logic.
I have one database with two columns (Name and Absent) + one button.
What I need to do?
When I click one button its should this:
if you find in the ''Absent'' column, blank spaces (or blank cells). Fufill it ONLY with the word ''false''.
| Name | Absent |
| Chairman | True |
| Chairman |
| Ruben | ........ |
| Shuman | True |
| Andrew | ........ |
Then please anyone can help?

VulpesRank #55 · 29.2K reputationPosted Jan 12, 2015, 12:26 PM EST
IsraelRank #1,223 · 1.5K reputationPosted Jan 14, 2015, 3:31 AM EST
IsraelRank #1,223 · 1.5K reputationPosted Jan 21, 2015, 8:59 AM EST
I try this:
UPDATE MyTable SET Absent='False' and clickIn='False' and clickOut='False' WHERE ISNULL(Absent, ClickIn, ClickOut) OR Absent='' OR ClickIn='' OR ClickOut;
VulpesRank #55 · 29.2K reputationPosted Jan 21, 2015, 11:12 AM EST
IsraelRank #1,223 · 1.5K reputationPosted Jan 23, 2015, 5:17 AM EST
This is one of the very importante code for me to learn.
Firstly for what I need to do I do put it in the load event. But what kind of problem I meet now. Unfortunatly it's doesnt react (no error message... no buggs).
Then I do drop here the whole code. But its gives this message: A operação tem que utilizar uma consulta actualizável:
IsraelRank #1,223 · 1.5K reputationPosted Jan 23, 2015, 5:23 AM EST
This word mean:
The operation should use a query actualized.
IsraelRank #1,223 · 1.5K reputationPosted Jan 23, 2015, 5:37 AM EST
But when click the message error doesnt appear. Its update only the clock_out column. What happen?
VulpesRank #55 · 29.2K reputationPosted Jan 23, 2015, 5:41 AM EST
You need to call ExecuteNonQuery after each one:
comm.CommandText = "UPDATE 1 SET Absent='Ausente' WHERE ISNULL(Absent) OR Absent='True'";
comm.ExecuteNonQuery();
comm.CommandText = "UPDATE 1 SET clock_In='Ausente' WHERE ISNULL(clock_In) OR clock_In=''";
comm.ExecuteNonQuery();
comm.CommandText = "UPDATE 1 SET clock_Out='Ausente' WHERE ISNULL(clock_Out) OR clock_Out=''";
comm.ExecuteNonQuery();
IsraelRank #1,223 · 1.5K reputationPosted Jan 23, 2015, 6:07 AM EST