473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Parameter Value error

why does this code cause the "Parameter count does not match Parameter Value
count" error.???

Dim arGetaffManageparms() As System.Data.SqlClient.SqlParameter = New
System.Data.SqlClient.SqlParameter(3) {}

arGetaffManageparms(0) = New
System.Data.SqlClient.SqlParameter("@IDaff2Manage" ,
System.Data.SqlDbType.Int)

arGetaffManageparms(0).Value = CInt(Request.QueryString("ID2Manage"))

arGetaffManageparms(1) = New
System.Data.SqlClient.SqlParameter("@affItemID", System.Data.SqlDbType.Int)

arGetaffManageparms(1).Direction = System.Data.ParameterDirection.Output

arGetaffManageparms(2) = New
System.Data.SqlClient.SqlParameter("@affItemName",
System.Data.SqlDbType.VarChar, 35)

arGetaffManageparms(2).Direction = System.Data.ParameterDirection.Output

Dim getAffInfoStuff As System.Data.SqlClient.SqlDataReader =
ijsdac.SqlDataJunction.ExecuteReader(Configuration Settings.AppSettings(gen3.
Global.CfgKeyConnString), "getAffManage", arGetaffManageparms)

Jul 21 '05 #1
5 4214
test <te**@brainscanstudios.com> wrote:
why does this code cause the "Parameter count does not match
Parameter Value count" error.???


It suggests to me that your SQL statement contains a different number
of parameters than the ones you've configured. What is your SQL
statement here?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
thanks for you response...
here is my stored procedure

CREATE PROCEDURE getAffManage

(
@IDaff2Manage int,
@affItemID int OUTPUT,
@affItemName Varchar(35) OUTPUT
)
AS

SET NOCOUNT ON;
SELECT @affItemID=affregID, @affItemName=affItemRefName
FROM affregistrationitems where affid=@IDaff2Manage;
GO
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
test <te**@brainscanstudios.com> wrote:
why does this code cause the "Parameter count does not match
Parameter Value count" error.???


It suggests to me that your SQL statement contains a different number
of parameters than the ones you've configured. What is your SQL
statement here?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
test <te**@brainscanstudios.com> wrote:
thanks for you response...
here is my stored procedure


And are you setting the command type to StoredProcedure?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4
that fixed the issue...THANKS!
I don't know why I forgot that... but thanks!
Now, it is not failing, but no data is coming back... and that doesn't make
any sense.
The only change to my code, since my initial question is the following line.

Dim getAffInfoStuff As System.Data.SqlClient.SqlDataReader =
ijsdac.SqlDataJunction.ExecuteReader(Configuration Settings.AppSettings(gen3.
Global.CfgKeyConnString), "getAffManage", arGetaffManageparms)

it is now:
Dim getAffInfoStuff As System.Data.SqlClient.SqlDataReader =
ijsdac.SqlDataJunction.ExecuteReader(Configuration Settings.AppSettings(gen3.
Global.CfgKeyConnString), system.data.CommandType.StoredProcedure,
"getAffManage", arGetaffManageparms)

.... nothing is coming out.

tp

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
test <te**@brainscanstudios.com> wrote:
thanks for you response...
here is my stored procedure


And are you setting the command type to StoredProcedure?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #5
test <te**@brainscanstudios.com> wrote:
that fixed the issue...THANKS!
I don't know why I forgot that... but thanks!
Now, it is not failing, but no data is coming back... and that doesn't make
any sense.
The only change to my code, since my initial question is the following line.

Dim getAffInfoStuff As System.Data.SqlClient.SqlDataReader =
ijsdac.SqlDataJunction.ExecuteReader(Configuration Settings.AppSettings(gen3.
Global.CfgKeyConnString), "getAffManage", arGetaffManageparms)

it is now:
Dim getAffInfoStuff As System.Data.SqlClient.SqlDataReader =
ijsdac.SqlDataJunction.ExecuteReader(Configuration Settings.AppSettings(gen3.
Global.CfgKeyConnString), system.data.CommandType.StoredProcedure,
"getAffManage", arGetaffManageparms)

... nothing is coming out.


I suggest you look at what's happening on the database with a profiler.
That may give you some hints.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
4
by: js | last post by:
I have a stored procedure named "processInventory" like the following. Depending on the passed in parameters, I would like to add a WHERE clause for "select" action. For example, if any varchar...
1
by: Srini | last post by:
I have written two simple webservice functions and trying to consume them through a client piece. Both the webservice functions have similar signature....
4
by: Todd Perkins | last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually rely on google. So I hope I have enough info contained. Thank you in advance for any help! Problem: I am getting...
2
by: Robert E. Flaherty | last post by:
I am using System.Data.OracleClient (Oracle Provider for OLE DB 9.2.0.4.0) in an ASP.NET 1.1 app. I am evoking a stored procedure with a number of input parameters and two output parameters, both...
2
by: drisso | last post by:
Hello, I have searched that error on these message boards, msdn and crystaldecisions.com. I found tutorials that showed how to export a crystal report to pdf, but like many others I am getting...
8
by: Patreek | last post by:
Hi, On the line where I'm assigning RecordCount to be the value of my output parameter, I'm getting the generic "Object reference not set to an instance of an object" error. I've isolated it...
11
by: dahuzizyd | last post by:
Hi all: I think I had a problem with using out parameter , why the instance of 'SubClass' can't convert to 'BaseClass' ? my code is : ---------------------------------------------- using System;...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
11
by: wuzertheloser | last post by:
Write a program which calculates the integral of the function f(x)=(A*x^m)/n! on the interval from a to b (0<a<b). In the main program, scanf a double value for m and a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.