Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2005, 01:37 PM
Registered User
 
Join Date: Nov 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default retrieve varbinary using StoredProc with OUTPUT

Hi

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

Alvin


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
SqlCommand.ExecureNonQuery()
Console.Writeline("Output param is {0}", Convert.ToBase64(testBinary)); ====> Don't see the value from Stored Proc

StoredProc
CREATE PROCEDURE test
testBinary (100) OUTPUT
AS
BEGIN
 select @testBinary = testbin from testTable
END








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





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