IDataReader has a .GetBytes method.
Something like this:
object o = dataReader.GetValue (123);
Console.WriteLine ("");
byte[] byteCodes = new byte[8];
long len = dataReader.GetBytes(123, 0, byteCodes, 0, 8);
Console.Write("Byte codes: ");
for (int i = 0; i < len; i++)
{
Console.Write(byteCodes[i].ToString("x"));
}
}
That was getting a timestamp value (8 length). You'll need to rework it, if
the length is unknown.
123 represents the ordinal position of the select statement.
Select lastname, firstname from Emp
lastname ordinal is 0
firstname ordinal is 1
I used 123 so it would stand out.
"david" <da***@discussions.microsoft.comwrote in message
news:E1**********************************@microsof t.com...
I remember that there are functions to do it, but I forgot their names.
Anyone can give me a help?
Thank you.
David