sqlcon = new SqlConnection(strCon);
FileStream FStream = new FileStream(strImage, FileMode.Open, FileAccess.Read);
BinaryReader BReader = new BinaryReader(FStream);
byte[] byteImage = BReader.ReadBytes((int)FStream.Length);
SqlCommand sqlcmd = new SqlCommand("insert into tb_Image(photo) values(@photo)", sqlcon);
sqlcmd.Parameters.Add("@photo", SqlDbType.Image).Value = byteImage;
sqlcon.Open();
sqlcmd.ExecuteNonQuery();
sqlcon.Close();
return true;
//数据库中photo类型为image类型