G
Guest
Hi All,
I'm writing a program that deals with product selling. one of my forms
contains a dataGrid which the user enters the product the customer wants to
buy.
this table can contain one line (means one product) or more. each product is
unique and can not be sold twice (i.e, car with license plate). my DB is SQL
and i'm using stored procedures. when the user click the last OK button, i
want to check that none of these products have been sold in different
station (untill one pressed the ok button, the car can still be sold), i'm
using a transaction and i want to check all the products at the same
transaction so if one has been sold, i will notify the user and rollback the
insert command. my problem is to send all the data to the sql at the same
time. how can it be done?
if i'll call for each line to the SP there is a situation which i'll insert
2 lines and i won't insert the third (because it can't be sold) and i don't
want to do so, i want to insert all lines together or not to insert at all.
Thanks, i hope i was cleared.
I'm writing a program that deals with product selling. one of my forms
contains a dataGrid which the user enters the product the customer wants to
buy.
this table can contain one line (means one product) or more. each product is
unique and can not be sold twice (i.e, car with license plate). my DB is SQL
and i'm using stored procedures. when the user click the last OK button, i
want to check that none of these products have been sold in different
station (untill one pressed the ok button, the car can still be sold), i'm
using a transaction and i want to check all the products at the same
transaction so if one has been sold, i will notify the user and rollback the
insert command. my problem is to send all the data to the sql at the same
time. how can it be done?
if i'll call for each line to the SP there is a situation which i'll insert
2 lines and i won't insert the third (because it can't be sold) and i don't
want to do so, i want to insert all lines together or not to insert at all.
Thanks, i hope i was cleared.