ekendricks
Posts: 34
|
| Posted: 05/28/2006, 10:47 AM |
|
Using CCS - ASP - Sql 2005
Add/Edit db records using an editable grid with conditions:
I need a grid with a list of 30 to 40 input/edit rows. Each row would have all fields pre-populated except the value field (numeric - quantity)... Each row will contain 3 hidden pre-populated fields. What I would like to do is only insert rows into the database where the quanity field is <> 0 . I know that the row is not considered blank if one of the fields contains a value, and in this case, all but one field will contain a value. What I need to do is make the insert of a row dependent on the value of the field "Value/Quantity", and ignore values in other fields on the same row.
Thanks
Ernest
|
 |
 |
Edd
Posts: 547
|
| Posted: 05/28/2006, 3:57 PM |
|
Ernest,
Use the custom insert / update facility on your editable grid, then call a stored procedure with the fields. The stored procuedure then can determine what does and does not populate teh database.
Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
marcwolf
Posts: 361
|
| Posted: 05/30/2006, 11:47 PM |
|
Or...
In the Grid.BeforeExecuteInsert, BeforeExecuteUpdate, or BeforeExecuteDelete
if GRID.datasource.QTY.value = 0 then
GRID.command.CommandOperation = 9
What this does is to send an illegal but harmless operation command to the SQL enginge. Because the engine does not find a Code 9 then it exits with no error - and No update.
Hope this helps
Remember - you have to work with the DATASOURCE values
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
|