Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi All,
 
In my web application (VS2008), I have to transfer result of a query in MS SQL 2005 from one MS SQL instance to another using a portable memory device (both servers are in different networks). The query results include images stored in varbinary(max) fields and varchar fields.
 
I looked at saving the query results in XML Files, Excel, and even Access 2007. Typical issue is handling of varbinary data. My research suggest that there is conversion issue between varbinary(max) in SQL 2005 and OLE Object in Access.
 
What would be the best way here? If any one has worked on this before, can you please share experience/code snippets?
Posted 10-Apr-13 7:11am
GeoNav745
Edited 10-Apr-13 7:17am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

How about converting the VARBINARY(Max) as a Base64 string and saving as string in other OLEDB databases?
  Permalink  
Comments
GeoNav at 10-Apr-13 20:41pm
   
As I understand, you are suggesting a loop through the dataset populated by the query to fetch each varbinary value and convert it to Base64 string and save it in the OLEDB database. I also convert this back to the varbinary, when I upload this to SQL Server. Is it possible for you to give an example?
GeoNav at 11-Apr-13 10:06am
   
Well, I just got the SQL way of encoding varbinary(max) to / from base64 string. Thanks for the suggesting this approach..... Intends to get the query result as base64 string instead of varbinary and they save is as xml file through a datatable..........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 265
1 Sergey Alexandrovich Kryukov 202
2 George Jonsson 185
3 King Fisher 185
4 CPallini 155
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100