How do I fix this error?

Posted on 2008-01-24
Medium Priority
Last Modified: 2013-12-25
I have the Update in the TableAdapter use a sp. One of the Parameters is CustomerID, which is set as Input. Now when this sp tries to execute I am getting an error. This is the error:
>Formal parameter '@CustomerID' was defined as OUTPUT but the actual parameter not declared OUTPUT

I'm not sure what is mean by "Formal" and "Actual".  Is this difficult to fix?

Question by:Lisa0812
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20740403
formal/actual is the difference between how the parameter is defined in the procedure vs how you define it in your .net code.
>One of the Parameters is CustomerID, which is set as Input.
so, the procedure probably defines it as OUTPUT parameter, so you have to adjust the .net code accordingly.

if that is not clear enough, post the relevant code.

Author Comment

ID: 20740470
but in the Procedure it is not defined as Output, here is the procedure:

CREATE PROCEDURE dbo.spCustomer_Update

      @CustomerName varchar(40),
      @Address varchar(90),
      @City varchar(30),
      @State char(2),
      @Zip varchar(10),
      @Phone varchar(20),
      @Fax varchar(20),
      @Website varchar(60),
      @Email varchar(50),
      @Comment varchar(4096),
      @CustomerID int,
      @Modified Timestamp OUTPUT
LVL 39

Expert Comment

by:Pratima Pharande
ID: 20740552
I think formal means delcared in code

actual means in store proc

In this you have declare culstomerid as output in code so remove that...

otherwise share your code with us
LVL 35

Accepted Solution

David Todd earned 200 total points
ID: 20740623

>> but in the Procedure it is not defined as Output


But the procedure shows that the next parameter is declared as output
>> @Modified Timestamp OUTPUT

I would hazard a guess that maybe you have @CustomerID declared as output in .net, or @Modified is not defined as output and should be.

Did you write the procedure? Is it an existing procedure used by other code, or a new procedure?


Author Comment

ID: 20740630
I found the problem.
In fact I had set it using the designer and the CustomerID originally had been set as InputOutput and I had changed it, and it shows as such in the Designer. But the Code it write didn't change. So I went in and changed it by hand, and now it seems to work.

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Microsoft provides a rich set of technologies for High Availability and Disaster Recovery solutions.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question