Convert varbinary->nvarchar->to display


S

Sunit Joshi

Hello All
I have a field which is of type varbinary(256). Now in my sql
statement I cast it to nvarchar but when do the DataReader.GetString()
method, I get the string with end-of-string marker, \0\

This is what I do in the SQL statement
cast(S.ObjectMoniker as nvarchar(100)) as Filepath

When I try this
string filename = oDbReader.GetString(iFilePathOrdinal)

I get the filenam as \\test\filename1\0

any ideas what I need to do here..??

thanks
Sunit
(e-mail address removed)
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VarBinary ? 4
varchar or nvarchar 2
NVARCHAR specific methods 1
RowFilter and VARBINARY fields 0
Varbinary col in a DataTable 0
Varbinary col in datatable 3
SqlServerCe VarBinary Question 2
NVarchar vs NText 6

Top