Hi,
I failed to convert following 2 type of data into readable record by using following code. This data migrated from lotus note to sql server by using LEI.
Anyone know how?
in image data type:
0x82FF520001000000000000000000AF05002DAF0500000000000000000000000000000000000000000000000000000000000000000000000000000000000086010000000054040F0000000F000000000000008304010085FF08000500000881028304010085FF3B000500000820202020202020202020202020202020202020
in binary data type:
0x82FF520002000000000001000000AF052337AF0500000000000000000000000000000000000000000000000000000000000000000000000000000000000086010000000054040F0000000F000000000000008304020085FF08000600000900000000000000000000000000000000000000000000000000000000000000000000
string sqlText = "..."
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
SqlCommand command = new SqlCommand(sqlText, connection);
connection.Open();
SqlDataReader dr = command.ExecuteReader();
if ( dr.Read())
{
const int CHUNK_SIZE = 2 * 1024;
byte[] buffer = new byte[CHUNK_SIZE];
long bytesRead;
long fieldOffset = 0;
using (var stream = new MemoryStream())
{
while ((bytesRead = dr.GetBytes(dr.GetOrdinal("checklist"), fieldOffset, buffer, 0, buffer.Length)) > 0)
{
stream.Write(buffer, 0, (int)bytesRead);
fieldOffset += bytesRead;
}
Response.BinaryWrite(stream.ToArray());
}