3
Reply

how to handle null value while getting image in asp.net

sowjanya bommithi

sowjanya bommithi

Nov 5 2016 1:19 AM
276
Session["EmpPhoto"] = dsUser.Tables[0].Rows[0]["EmpPhoto"].ToString();
 
imageUser.ImageUrl = Session["Photo"].ToString();//here i am getting error 
 
i have to       show username and userphoto after he logged into the site. but for a particular user i dont have image so i am getting error" Object reference not set to an instance of an object.
"
 

Answers (3)