Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 30th, 2005, 01:37 PM
Registered User
Join Date: Nov 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default retrieve varbinary using StoredProc with OUTPUT


I have a stored proc with a varbinary OUTPUT param and I am trying to retrieve the value of this variable in the C# using SqlCommand and setting its parameters. However, I am not able to retrieve the value of varbinary variable in C# for some unknown reasons. I would really appreciate your help. Thanks


Byte [] testBinary = new Byte[100];
SqlParameter param1 = SqlCommand,Parameters.Add("@testBinary", SqlDBType.Binary, 100);
param1.value = testBinary
SqlCommand.CommandType = CommandType.StoredProcedure
SqlCommand.Direction = ParameterDirection.Output
Console.Writeline("Output param is {0}", Convert.ToBase64(testBinary)); ====> Don't see the value from Stored Proc

testBinary (100) OUTPUT
 select @testBinary = testbin from testTable

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
How to write T-SQL to retrieve the required Output anilkumar.dwivedi SQL Language 3 June 26th, 2008 12:37 AM
Varbinary(max) performance issue musman0047 SQL Language 0 May 8th, 2008 08:20 PM
Storing data in a varbinary field in SQL mswombat Java Basics 2 February 9th, 2007 08:03 AM
Dumping StoredProc output to text File ao7711 SQL Server DTS 8 January 12th, 2006 04:41 PM
ASP.Net (Varbinary) s_chirags ADO.NET 0 September 13th, 2003 04:18 AM

All times are GMT -4. The time now is 08:57 AM.

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