473,586 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding Multiple Rows, Displaying Session Rows and then doing one insert

3 New Member
I need to produce a from where I can add multiple parts. Each time a user enters a part number, the description should be populated. The user can then click add and this part and description will be shown below. They have the option to add as many parts as they require. Once all parts are added the user fills in some general info eg description and then once a submit button is clicked all part info will be inserted into a table and general info will be inserted into another table with one unique ID. Can anyone point me in the right direction.
Apr 14 '10 #1
5 2468
Frinavale
9,735 Recognized Expert Moderator Expert
This question is way to big.
I don't have any idea of "which direction" you need to be pointed in.

What have you done so far to solve the problem?
Did you create a form? Do you know how to?
Did you add the controls that you need in order gather the information from the user on to the form? Do you know how to?
Did you try to gather the information? Do you know how to?
Are you having problems updating the database??

Please attempt to implement this application and when you have a specific question ask it. We can't answer "I want to write a program...how?" but we can answer "I have a TextBox on the page. How do I retrieve the text the user entered from it"

-Frinny
Apr 14 '10 #2
jsmyth13
3 New Member
@Frinavale
I have a form with 5 part related fields. Part No, Description Cost, Quantity and Total Cost. A user will enter a part no, a query will run and the description and cost will be populated. The user then enters the quantity and a calculation works out the total cost. I have this all working. There is then a comments field but this applies to all parts submitted on this session. I can insert this data into a table without any problem. My problem is - how do I allow the user to enter multiple parts - display them on the page as they enter them - they then enter details into the comments field and then hit the submit button to submit all part details and the comments field all related to a unique id, eg order number. I'm not sure how to store the part details before submitting to the database and how to allocate a unique id to all aspects. Do I need to submit code?
Apr 14 '10 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Ohhh I understand your question now.

There are a few approaches to this that you can take.
I think I'd be more inclined to suggest that you look into creating a Templated Control rather than using something like a GridView or a Repeater (but maybe that's just because I think they're cool).

Basically you're going to create a class that represents your "PartOrder" .
This class is going to have:
  • A Public Part Number Property
  • A Public Description Property
  • A Public Cost Property
  • A Public Quantity Property
  • A Public Total Cost Function (or ReadOnly Property) that calculates the total cost based on the quantity and cost properties
  • Some private validation methods if needed and maybe an IsValid Public function (or ReadOnly Property) so that you can check validation
  • And maybe a public Update method that updates the database...if you want

You will have a collection of the "PartOrder" class which it will use as the Data Source.

You could either bind this collection to your Templated Control or you can bind this collection to a GridView or a Repeater control.

Which ever way you chose to do this you're going to need to use a "Template" to specify how your data is displayed to the user.

If you use a GridView then you'll use one or more TemplateFields. In the TemplateField you can specify how your PartOrder is displayed to the user during "viewing" and during "editing". You can use different controls for each purpose.


I'm not sure what direction you're going to choose so let me know which you prefer before I start getting into more details about other options.

-Frinny
Apr 14 '10 #4
jsmyth13
3 New Member
Hi Frinny

Thanks for reply - I'm happy enough to go with a templated control if that is what you recommend. I have a very basic knowledge of programming though and have not worked with classes etc or templated controls.
Apr 15 '10 #5
Frinavale
9,735 Recognized Expert Moderator Expert
Well, if you have basic knowledge then let's stick with the GridView.
You'll still need to create a class for your Part Order though :)

-Frinny
Apr 15 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
13210
by: jason | last post by:
How does one loop through the contents of a form complicated by dynamic construction of checkboxes which are assigned a 'model' and 'listingID' to the NAME field on the fly in this syntax: Hunter_69. Here is what the form looks like. I have the difficulty of inserting the multiple items selected by the user the first time he visits and uses...
4
6129
by: shank | last post by:
Visually, the page will look somewhat like a spreadsheet. It could have hundreds of records (rows) displayed. I want to enable the user to edit any one or any number of records and any fields, then click a save button to UPDATE the SQL table. I'd like to use stored procedures if possible. How is this done? Where do I start? thanks
1
6311
by: DC Gringo | last post by:
I'm having such a problem with this DropDownList in a user control that is posting back and throwing an error: System.Web.HttpException: A DropDownList cannot have multiple items selected <ASP:DROPDOWNLIST ID="lbCountriesWiz" ENABLEVIEWSTATE="true" FONT-SIZE="8pt" ONSELECTEDINDEXCHANGED="ddlQueryProvinces" AUTOPOSTBACK="True"...
2
2701
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update button, seems simple. I am using ALL visual controls (supposedly to simplify things. If I was not using the visual controls and calling an ExecuteNonQuery...
3
4866
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
1
3268
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple days of struggling, I figure asking you all (the experts) will keep me from going down some dark and dangerous road. The project I have is a fairly...
4
1594
by: Sandeep | last post by:
Hi I am doing one thing in my website ,actually i want to add controls dynamically to a web form and want to access the elements but when i postback the form,and access that control, it gives error Object reference not set to an instance of an object. ************************************************************************...
1
2910
by: sneha123 | last post by:
There will be some 20 questions and for each question there will be 4 choices.what i want to do is to select multiple answers by clicking the checkbox. i m using asp.net,vb.net pls help me we have written the code using radio button for selecting single item.but we want to replace it with checkbox to select multiple items. the code...
20
2543
by: p175 | last post by:
Hi people, I have a stored procedure that creates many Global temporary session tables. Into each of these tables go the results of various processing using relational division all keyed and based on a common ID from an ID session table. So we can have various session tables with differing results but if they contain records, they are all...
1
3055
by: dhyder | last post by:
OK, like the title says my error is Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. I have looked into this a lot, but have not been able to find a solution to it. <%@ Page Language="c#" runat="server" debug="true" %> <%@ Import Namespace="System.Data" %> <%@ Import...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.