1
2
3
4
5
6
7
8
MemoryStream m = new MemoryStream(byteArrayFromDB);
StreamReader file = new StreamReader(m);

// If you need to read the stream out as text/string..
while ((line = file.ReadLine()) != null)
{
string code = line.Substring(line.Length - 12);
}