|
 |
ado_dotnet thread: Parameters in ADO.net
Message #1 by gjcreme@n... on Fri, 12 Apr 2002 18:24:08
|
|
I am having a problem using a command object to execute a stored procedure
in sql. It appears that when I create the parameter object to append to
the command object's parameter's collection, I need to give it a name as
well as a value. I never used to have to do this using ADO and VB6. Does
anyone know of a way to get around this requirement?
Thanks,
Greg
Message #2 by "Steve Brownell" <sbrownell@a...> on Fri, 12 Apr 2002 13:30:49 -0400
|
|
It's a good news/bad news situation.
In ADODB a SQLParameter didn't care about the parameter name. All that
mattered was that the parameters were in the same order as those
declared in the stored procedure. In ADO.NET you must actually give
them the same name used in the stored procedure.
So if you declared it @pParam in the stored procedure, you must give it
the name "@pParam" in the ADO.Net paramater object.
Steve Brownell
AllMeds, Inc.
-----Original Message-----
From: gjcreme@n... [mailto:gjcreme@n...]
Sent: Friday, April 12, 2002 2:24 PM
To: ADO.NET
Subject: [ado_dotnet] Parameters in ADO.net
I am having a problem using a command object to execute a stored
procedure in sql. It appears that when I create the parameter object to
append to the command object's parameter's collection, I need to give it
a name as well as a value. I never used to have to do this using ADO
and VB6. Does anyone know of a way to get around this requirement?
Thanks,
Greg
Message #3 by "greg robinson" <grobinson@d...> on Fri, 12 Apr 2002 18:45:29
|
|
I have not encountered this problem. I simply use
commandobject.parameter.add(name, value)
I am having a problem using a command object to execute a stored procedure
i> n sql. It appears that when I create the parameter object to append to
t> he command object's parameter's collection, I need to give it a name as
w> ell as a value. I never used to have to do this using ADO and VB6.
Does
a> nyone know of a way to get around this requirement?
> Thanks,
G> reg
|
|
 |