Converting to Byte Array after reading a BLOB from SQL in C#
Posted
by Soham
on Stack Overflow
See other posts from Stack Overflow
or by Soham
Published on 2010-04-17T10:36:34Z
Indexed on
2010/04/17
10:43 UTC
Read the original article
Hit count: 356
Hi All,
I need to read a BLOB and store it in a byte[], before going forward with Deserializing;
Consider:
//Reading the Database with DataAdapterInstance.Fill(DataSet);
DataTable dt = DataSet.Tables[0];
foreach (DataRow row in dt.Rows)
{
byte[] BinDate = Byte.Parse(row["Date"].ToString()); // convert successfully to byte[]
}
I need help in this C# statement, as I am not able to convert an object type into a byte[]. Note, "Date" field in the table is a blob and not of type Date;
Help appreciated; Soham
© Stack Overflow or respective owner