Home » U++ Library support » U++ SQL » SqlArray and data validation
|
Re: SqlArray and data validation [message #33355 is a reply to message #33343] |
Wed, 27 July 2011 12:48   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
forlano wrote on Tue, 26 July 2011 20:51 |
So the question is: How is the recommended way to validate the data the user enters BEFORE they are gone in the databas
|
I suspect the solution is WhenPreQuery callback...
EDIT: No, it isn't...
[Updated on: Wed, 27 July 2011 13:14] Report message to a moderator
|
|
|
Re: SqlArray and data validation [message #33358 is a reply to message #33343] |
Wed, 27 July 2011 17:37   |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
Hello, Luigi.
forlano wrote on Tue, 26 July 2011 20:51 |
How is the recommended way to validate the data the user enters BEFORE they are gone in the database
|
I suggest to use Accept function to check if valid values used for Ctrls (more about this here, on 18 section).
To set valid values SetFilter or SetConvert (with creation of specialised Convert class) functions may be used.
Also, NotNull property of Ctrl can be used to prevent empty values. TrimLeft, TrimRight or TrimBoth EditString Ctrl functions to trim spaces from left, right or both sides, respectively.
In the case of ArrayCtrl/SqlArray you could try to use WhenAcceptRow, WhenAcceptEdit notification callbacks in conjunction with IsEdit, IsInsert ArrayCtrl functions.
[Updated on: Wed, 27 July 2011 18:48] Report message to a moderator
|
|
|
Re: SqlArray and data validation [message #33360 is a reply to message #33358] |
Wed, 27 July 2011 19:51   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Sender Ghost wrote on Wed, 27 July 2011 17:37 | Hello, Luigi.
forlano wrote on Tue, 26 July 2011 20:51 |
How is the recommended way to validate the data the user enters BEFORE they are gone in the database
|
I suggest to use Accept function to check if valid values used for Ctrls (more about this here, on 18 section).
To set valid values SetFilter or SetConvert (with creation of specialised Convert class) functions may be used.
Also, NotNull property of Ctrl can be used to prevent empty values. TrimLeft, TrimRight or TrimBoth EditString Ctrl functions to trim spaces from left, right or both sides, respectively.
In the case of ArrayCtrl/SqlArray you could try to use WhenAcceptRow, WhenAcceptEdit notification callbacks in conjunction with IsEdit, IsInsert ArrayCtrl functions.
|
Hello,
thanks for the suggestions. I'll try them.
Luigi
|
|
|
|
|
Goto Forum:
Current Time: Tue May 13 07:38:39 CEST 2025
Total time taken to generate the page: 0.02557 seconds
|