The design was to keep the logic simple. When you execute a function to insert a record from your Windows form, you can use the execute statement in an If...Then block. Actually, the ExecuteNonQuery method will return the number of rows affected by the insert statement thus inserting a single record will return a 1 and not inserting a record will return a 0. Remember that a Boolean value contains a value of 0 for False and any other number other than 0 for True, which is usually 1. This makes the function return a 0 when False and any number other than 0 will correlate to a value of True.
Thearon
|