c# - Writing jpeg image into a SQL Server 2000 style TEXT field -
i have client asking me import jpeg files sql server database.
the problem database vendor build product in sql server 2000 (or earlier) although database sits on sql server 2008 r2 instance. appears old data looks it's being dumped big field of datatype text
.
is possible read jpeg file memorystream
write directly sql server database? if so, how go doing this? or, there better way?
thanks,
andre
i suppose if needed this, can build byte-stream string this:
memorystream ms = [your stream]; byte[] memorybytes = ms.toarray(); stringbuilder sbuilder = new stringbuilder(); foreach(byte nextbyte in memorybytes) sbuilder.append((char)nextbyte); string res = sbuilder.tostring();
then store in database passing string. should try , work out of client offering update database structure though ;)
Comments
Post a Comment