Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 794383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:18:17+00:00 2026-05-14T22:18:17+00:00

Good Afternoon All, I have a wizard control that contains 20 textboxes for part

  • 0

Good Afternoon All,

I have a wizard control that contains 20 textboxes for part numbers and another 20 for quantities. I want the part numbers and quantities loaded into the following table:

USE [Diel_inventory]
GO
/****** Object:  Table [dbo].[QUOTEDETAILPARTS]    Script Date: 05/09/2010 16:26:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[QUOTEDETAILPARTS](
[QuoteDetailPartID] [int] IDENTITY(1,1) NOT NULL,
[QuoteDetailID] [int] NOT NULL,
[PartNumber] [float] NULL,
[Quantity] [int] NULL,
CONSTRAINT [pkQuoteDetailPartID] PRIMARY KEY CLUSTERED 
(
[QuoteDetailPartID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[QUOTEDETAILPARTS]  WITH CHECK ADD  CONSTRAINT [fkQuoteDetailID] FOREIGN KEY([QuoteDetailID])
REFERENCES [dbo].[QUOTEDETAIL] ([ID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

Here’s the snippet from my sproc for this insert:

set @ID=scope_identity()

Insert into dbo.QuoteDetailParts
(QuoteDetailPartID, QuoteDetailID, PartNumber, Quantity)
values (@ID, @QuoteDetailPartID, @PartNumber, @Quantity)

When I run the ASPX page, I receive an error that there are too many arguments specified for my stored procedure. I understand why I’m getting the error, given the above table layout. However, I need help in structuring my insert syntax to look for values in all 20 PartNumber and Quantity field pairs.

Thanks,
Sid

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:18:18+00:00Added an answer on May 14, 2026 at 10:18 pm

    Your QuoteDetailPartID is an IDENTITY field – you cannot insert a value into an IDENTITY field (except if you explicitly enable that – only do that if you really really must).

    You should change your stored proc to use:

    INSERT INTO dbo.QuoteDetailParts(QuoteDetailID, PartNumber, Quantity)
    VALUES(@QuoteDetailID, @PartNumber, @Quantity)
    

    You can then get back the newly inserted QuoteDetailPartID by inspecting the SCOPE_IDENTITY() function:

    SET @QuoteDetailPartID = SCOPE_IDENTITY()
    

    I wouldn’t make your stored proc go “look for” the twenty fields – do that in your wizard logic, in your C# or VB.NET code, and call the stored proc to insert a single QuoteDetailPart as many times as you really need (you might only have 3 detail parts to insert, after all)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good Afternoon All, I have written an SSIS 2005 package that contains a conditional
Good afternoon all. I have a page that displays data in a gridview based
Good afternoon, I wish to have a script that will look for all files
Good Afternoon All, I have two tables in my SQL Server 2005 DB, Main
Good Afternoon All, I have a table inside a div. The div has a
Good afternoon people's I have built a jquery plugin that I use on my
Good afternoon all Here is my scenario: I have user controls within a master
Good afternoon. I have been making a small openGL based app for android that
Good Afternoon, I have a html aspx page that has many many div elements.
Good afternoon, with all the buzz around the iPhone / AppStore etc, I felt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.