c# - File to Byte array is producing Odd Hex Length -
i have hex value has odd length. used file byte[] code , both produced odd character length of hex. after value in database, copy hex value because need migration apply bunch of other databases. can't convert hex byte[] because of odd length. suggestions jump on hurdle? there hex byte[] converter can handle odd number of lengths?
encoder one
var filestream = new filestream(openfiledialog.filename, filemode.open, fileaccess.read); var bytes = new byte[filestream.length]; filestream.read(bytes, 0, convert.toint32(filestream.length)); filestream.close(); unitofwork.filerepository.add(new objectmodel.file.file { filearray = bytes, filename = path.getfilename(openfiledialog.filename), fileextension = path.getextension(openfiledialog.filename), /interactionid = _interaction.id, ); unitofwork.save(user.id);
since doing copy/paste microsoft sql server management studio there maximum length can show in result. have use tool direct copy/paste of sql database value.
or go in tools -> options -> query results -> sql server -> result grid
change maximum characters retrieved
xml data
unlimited
, change sql query add for xml path('')
@ end
it generate xml file in result grid, click on , copy/paste hex value there
Comments
Post a Comment