日期:2014-05-18 浏览次数:20888 次
string sql2 = "Update [Employee] set photo=@photo where workNo='" + emp.WorkNo + "'"; /// <summary> /// 向数据库里插入图像格式的字段(和上面情况类似的另一种实例) /// </summary> /// <param name="strSQL">SQL语句</param> /// <param name="fs">图像字节,数据库的字段类型为image的情况</param> /// <returns>影响的记录数</returns> public static int Execute(string SqlStr, byte[] photo) { OleDbCommand cmd = new OleDbCommand(SqlStr, Conn); OleDbParameter myParameter = new OleDbParameter("@photo", SqlDbType.Image); myParameter.Value = photo; cmd.Parameters.Add(myParameter); int result = cmd.ExecuteNonQuery(); return result; } if (dt.Rows[0]["photo"] != null && dt.Rows[0]["photo"].ToString()!="") { pictureBox1.Image = PictureOpreate.ByteArrayToImage((byte[])dt.Rows[0]["photo"], 1); }
------解决方案--------------------
http://www.cnblogs.com/lujin49/archive/2011/08/06/2129516.html
http://www.cnblogs.com/sufei/archive/2010/09/24/1834054.html
------解决方案--------------------
破论坛!怎么不显示啊。。。
http://www.cnblogs.com/lujin49/archive/2011/08/06/2129516.html
http://www.cnblogs.com/sufei/archive/2010/09/24/1834054.html