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?
VulpesPosted Jan 12, 2015, 5:26 PM
IsraelPosted Jan 23, 2015, 11:07 AM
VulpesPosted Jan 23, 2015, 10:41 AM
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();
IsraelPosted Jan 23, 2015, 10:37 AM
But when click the message error doesnt appear. Its update only the clock_out column. What happen?
IsraelPosted Jan 23, 2015, 10:23 AM
This word mean:
The operation should use a query actualized.
IsraelPosted Jan 23, 2015, 10:17 AM
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:
VulpesPosted Jan 21, 2015, 4:12 PM
IsraelPosted Jan 21, 2015, 1:59 PM
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;
IsraelPosted Jan 14, 2015, 8:31 AM