all groups > sql server programming > february 2007 >
You're in the

sql server programming

group:

Getting Varbinary in C#.


Getting Varbinary in C#. Archana
2/28/2007 11:07:52 PM
sql server programming: Hi all,

I want to return text datatype from stored procedure. So what i did is
used varbinary as output paramter to stored procedure.

My Store procedure is
CREATE proc test_text
@outtext varbinary(16) output
AS
begin
declare @ptr varbinary(16)
select @ptr = TEXTPTR(addr) from emp where id = '1000110109'
print @ptr
set @outtext = @ptr
end
GO

How will i get actual address in code which i have written in c#.

Means how to convert varbinary to string in C#.

Any help will be truely appreciated.

thanks in advance.
Re: Getting Varbinary in C#. Erland Sommarskog
3/1/2007 12:00:00 AM
Archana (trialproduct2004@yahoo.com) writes:
[quoted text, click to view]

You can do much with that pointer in C#. You need to use the READTEXT
function in your stored procedure to receive the string value.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button