//定义将图片转化为长二进制代码的函数getphoto()
public Byte[] getphoto(string photopath){
string str = photopath;
FileStream file = new FileStream(str, FileMode.Open,
FileAccess.Read);
Byte[] bytBLOBData = new Byte[file.Length];
file.Read(bytBLOBData, 0, bytBLOBData.Length);
file.Close();
return bytBLOBData;
if (this.pictureBox1.Image != null){
sql1 = sql1 + ",Photo";