You can't test against System.DBNull - that's a class. Either use System.DBNull.Value, or try this:
object o = ds3.Tables["tempEmpDetails"].Rows[0]["Emp_Photo"];
if (o is System.DBNull))
{
pictureBox2.Image = Properties.Resources.profile;
}
else
{
Byte[] byteBLOBData = (Byte[])(o);
MemoryStream stmBLOBData = new MemoryStream(byteBLOBData);
pictureBox2.Image = Image.FromStream(stmBLOBData);
}