Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2006, 04:55 AM
MDM MDM is offline
Authorized User
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

 
Old June 29th, 2006, 06:14 PM
Authorized User
 
Join Date: Feb 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hi There,
I am working on something similar, but I set up different fields on the form as well as the database for each part and the respective quantities, I also had a lot of trouble calculating total on the code behind and passing them as parameters, so I finally did all the calculations in the store procedure itself by passing all the values through the parameters. Hope this helps...

Quote:
quote:Originally posted by MDM
 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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
vb.net sql autonumber insert GIGAM25 SQL Language 1 July 10th, 2008 01:10 AM
How to connect to Access db thru VB.NET? am_kuthus Visual Studio 2008 1 June 3rd, 2008 04:48 AM
Connecting to Access 20007 DB with vb.net JohnBoy VB.NET 1 May 21st, 2008 01:26 PM
Insert a CATIA preview in VB.net Forms Zaman_mech VB How-To 1 September 21st, 2007 12:01 PM
Data insert into Acess using vb.net (1.1) MDM VB Databases Basics 0 March 5th, 2006 01:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.