Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 24th, 2006, 09:25 PM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Return output variable to VB from SQL stored proc

I'd like to use an IDENTITY column instead of create a new GUID for the Time Tracker application.

I modified the sprocs to return the ID via SCOPE_IDENTITY(), but what steps would I need to take to incorporate the ID returned from the sproc as an output variable to the VB code?
Reply With Quote
  #2 (permalink)  
Old March 27th, 2006, 10:24 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

You'll need to have an Output parameter in your stored procedures to return an Integer data type containing the Identity value. Then you'll need to set the SQLCommand object with an output parameter. After you execute your stored procedure, you'll want to query the output parameter value in the Parameters collection of the SQLCommand object.

Thearon
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing return value of a Stored Proc in a Session mahajanvit ASP.NET 2.0 Basics 0 November 2nd, 2006 10:16 AM
Return 2 Recordsets from 1 Stored Proc Gordie Classic ASP Databases 0 July 3rd, 2006 06:34 PM
problem with a stored proc trying to return blobs Phrozt SQL Server 2000 2 May 12th, 2006 10:36 AM
How i can OUTPUT in Stored Proc yoord SQL Server 2000 2 July 19th, 2004 04:11 PM
problems with stored proc and output parameters zieg42 VB.NET 2002/2003 Basics 1 June 12th, 2004 08:11 AM



All times are GMT -4. The time now is 07:37 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.