Re: Using Stored Procedure at sqlDataAdapters with output parameters



You must create an OUTPUT parameter in the SelectCommand.Parameters
collection. It can be captured once the Fill is executed.
Actually, for this SQL I would probably not use a Fill because this does not
return a rowset. I would use a scalar, code the TSQL like this

select COUNT ( * ) FROM tblXUDUserShip

and use the ExecuteScalar method to return the value.

This is explained in my book "ADO and ADO.NET Examples and Best Practices".

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Esref DURNA" <esref_durna@xxxxxxxxxxxxx> wrote in message
news:%233ahKdEPGHA.3840@xxxxxxxxxxxxxxxxxxxxxxx
declare @Count int


select FirstName,SurName,@Count AS BankaSayisi FROM tblXUDUserShip



I have a Stored Procedure Which Ends with these returns.

I Create a SqlDataAdapter with a sqlcommand with type stored procedure

I m using this SqlDataAdapter as like .Fill(DataSet);

How I Coult get The Output parameter "Count" from this adaptor when it is
Filling the dataset?






.



Relevant Pages

  • Re: Invalid property size within Parameters
    ... values from stored procedures you use ExecuteScalar not ExecuteNonQuery. ... > stored procedure and the code. ... > Dim getConn As New Connection ... > 'Create output parameter ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Scope_Identity() - Output parameter or not?
    ... If you are using a stored procedure, you can return Scope_Identityand it ... will attach to the return parameter. ... Using ExecuteScalar() gives you a firehose cursor with very few lines of ... Using an output parameter to return Scope_Identity ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Value from store procedure
    ... you need to use an output parameter. ... :> That's odd. ... :> I have a simple stored procedure that takes a lookup ... Roland Hall ...
    (microsoft.public.inetserver.asp.db)
  • Re: Value from store procedure
    ... : stored procedure: resultset, return parameter, and output parameter. ... I'm not quite up-to-speed on dotnet ...
    (microsoft.public.inetserver.asp.db)
  • Re: returning single value from stored procedure
    ... >> I would like to have a stored procedure that returns the maxium value ... >> @MemberNumber int, ... >> @NextNumber int OUT ... output parameter and return value. ...
    (microsoft.public.inetserver.asp.db)