473,511 Members | 10,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4219
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
57825
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
2181
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
3631
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
16955
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
2418
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
14238
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
1998
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
3412
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
2670
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
4367
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
7144
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...
0
7356
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
7512
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...
0
5671
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,...
1
5069
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...
0
3227
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...
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.