Re: SQL Server Stored Procedure with Output Parameter and ASP.NET SQLCommand
- From: "Patrick.O.Ige" <naijacoder@xxxxxxxxxxx>
- Date: Tue, 17 Jan 2006 14:50:37 +1100
Welcome Mr Not So Know it All to this newsgroup
Try looking at this article at :-
http://aspnet.4guysfromrolla.com/articles/062905-1.aspx
It should help you
Patrick
"Mr Not So Know It All" <djscratchnsniffing@xxxxxxxxx> wrote in message
news:1137465289.071250.107090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> im new to SQL Server and ASP.Net. Here's my problem. I have this SQL
> Server stored procedure with an input parameter and output parameter
>
> CREATE PROCEDURE [safety].[_getRCList]
> @in_rc varchar(8)
> @out_eList varchar(7) output
> AS
> select @out_eList = ecuid from _organization where rccode = @in_rc
> GO
>
> im trying to get the values from the select statement. for example, if
> @in_rc is a value that has mutiple ecuids, i would like to have the
> @out_eList equal to those values.
>
> here is the asp.net code im using to get the output parameters from the
> SQL Server stored procedure.
>
> sqlComm = new sqlCommand("_getRCList",conn)
> sqlComm.commandtype = commandtype.storedprocedure
>
> 'add input parameter
> sqlComm.parameters.add("@in_mcuid","lxkqchy")
> 'add output parameter
> sqlParameter = sqlComm.parameters.add("@out_eList",sqlDBtype.varchar)
> sqlParameter.size = 20
> sqlParameter.direction = parameterdirection.output
> 'execute command
> dtrEList = sqlComm.executeReader(CommandBehavior.CloseConnection)
> response.Write("<br> rows : " & dtrEList.hasrows & "<br>")
> while dtrEList.read()
> response.Write("<li>")
> response.Write("CUID " & dtrEList(0) & "<br>")
> end while
> dtrEList.close()
>
> is this the right way to get values from a stored procedure? please
> help...
>
.
- Follow-Ups:
- Re: SQL Server Stored Procedure with Output Parameter and ASP.NET SQLCommand
- From: Mr Not So Know It All
- Re: SQL Server Stored Procedure with Output Parameter and ASP.NET SQLCommand
- References:
- SQL Server Stored Procedure with Output Parameter and ASP.NET SQLCommand
- From: Mr Not So Know It All
- SQL Server Stored Procedure with Output Parameter and ASP.NET SQLCommand
- Prev by Date: Re: how to rate a post?
- Next by Date: Re: webctrl_client display issues...please help...
- Previous by thread: SQL Server Stored Procedure with Output Parameter and ASP.NET SQLCommand
- Next by thread: Re: SQL Server Stored Procedure with Output Parameter and ASP.NET SQLCommand
- Index(es):
Relevant Pages
|