I will give you a suggestion ie,
instead of doing it from the front-end you can just write a stored procedure in your database and access that database.
This would reduce the complexity and also satisfies code minimization.
I can give you a example, you try it and you can reach me out for any queries.
I have developed a shopping cart application and i have the following tables:
1. Customers(Id, UserName, Password)
2. Address (Id, FirstName, LastName, EmailID, Country, State, City)
all these tables are linked with each other (they have foreign key relation)
So, your proc should be sumthing like this:
CREATE PROC GenerateOrder
DECLARE @CustomerId int,
INSERT INTO Customer(UserName, Password) VALUES(@UserName,@Password)
SELECT @CustomerId = @@IDENTITY
INSERT INTO Address(FirstName,LastName,EmailID,Country,State,city)
SELECT @AddressId = @@IDENTITY
INSERT INTO CustomerAddresses(CustomerId,AddressId)
Mark as answer if satisfied........
Shree M. ramuvalmiki07-22001, if this helps please login to Mark As Answer. | Alert Moderator