DB insert, VB.NET
Hi folks,
I ran into a problem and hope to get some help.
I am creating a form that inserts Production orders into the DB,i.e. OrderID, OrderDescription, OrderLocation, etc.
It is happens that orders may consist of several parts with their respective quantities.
-------------------------------------------------------------------------------------------------------------------------------------
I want to store several of the Parts IDs and respctive Qty;s under the same order ID, but do not know how.
-------------------------------------------------------------------------------------------------------------------------------------
- I was initially considering creating a string to hold the parts, but I want to be able to separate parts ID;s from each other and have the qty explicitly referenced
to the part ID.
- Sometimes, parts are being duplicated as parts of diferent orders and attempted to be inserted twice.
-------------------------------------------------------------------------------------------------------------------------------------
- I want to be able to identify the IDs and Qty of these parts prior to their insertion into DB.
------------------------------------------------------------------------------------------------------------------------------------
Here is the algorithm but I have no suggestions as to implementation:
1. Submit a form and attempt to insert into DB
2. on Submit_Click - redirect to another page, where on Page_Load I would check the existing records in the DB whether they contain ID's of the parts.
3. if the Part ID already exists, display orders containing the Part ID and ask for confirmation whether to proceed or not.
4. Use stored procedure to store the above in the DB
5. If no records exist - use stored procedure to insert record into the DB
I would appreciate your suggestions, as to the two problems above. I appreciate that people want to see some efforts being done prior to giving support and
therefore would ask to comment on implementation suggestions as to the one identified.
|