这里的字段“Certificate”的类型是[image];
object temp = dr[“Certificate”];
byte[] cert = new byte[0];
if (temp != null && temp is byte[])
cert = (byte[])temp;
这样,cert就变成了一个byte类型的数组。
C#中数据库中image类型可转为byte[]类型
最新推荐文章于 2024-04-29 17:34:03 发布
这里的字段“Certificate”的类型是[image];
object temp = dr[“Certificate”];
byte[] cert = new byte[0];
if (temp != null && temp is byte[])
cert = (byte[])temp;
这样,cert就变成了一个byte类型的数组。