I would like to write a program like sales in which there's two table to insert i.e: SaleHeader Table and SaleDetails Table. These two tables have (one to many) relationship. When I insert to SaleDetails Table I need to get SaleHeaderID to insert at SaleDetails.
Now I am using storeprocedure to insert SaleHeader information and to get back SaleHeaderID and I use query statements to insert SaleDetail information.
Any one can advise me for more effective way to insert to those two tables (having one to many relationship) ? Help me! Thanks in advance all.