Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / October 2007



Tip: Looking for answers? Try searching our database.

Output parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EdwardH - 27 Oct 2007 17:13 GMT
I am using SQL2000 and asp.net using vb.
I am returning a value for the number of records in a recordset that I am
binding to a datagrid but am not sure how to bring back value from SP.
Code for binding data from SP to grid:

       invConn = New
SqlConnection(ConfigurationManager.ConnectionStrings("Connectstring").ConnectionString)
       invConn.Open()
       invComm = New SqlCommand(zStrg, invConn)
       invComm.CommandType = Data.CommandType.StoredProcedure
       invComm.Parameters.AddWithValue("@ClCode", strClCode)
       iP = invComm.ExecuteReader
       iP.Read()
       dgPInv.DataSource = iP
       dgPInv.DataBind()
       Me.strUnits.Text = ? (SP
       iP.Close()
       invConn.Close()

With thanks
William Vaughn - 29 Oct 2007 18:38 GMT
You need to:
   1) Build another Parameter for the Output parameter and set its
direction to Output.
   2) Return all of the rows from the query (by whatever means you choose)
   3) Reference the output Parameter object .Value property

This is detailed in my book...

Signature

____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

>I am using SQL2000 and asp.net using vb.
> I am returning a value for the number of records in a recordset that I am
[quoted text clipped - 16 lines]
>
> With thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.