473,385 Members | 1,645 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,385 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 4212
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.