469,568 Members | 1,395 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

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 4062
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by js | last post: by
1 post views Thread by Srini | last post: by
2 posts views Thread by Robert E. Flaherty | last post: by
11 posts views Thread by dahuzizyd | last post: by
11 posts views Thread by wuzertheloser | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.