Before using any session variable you should check for it's existence. If that session is
NULL then definitely it'll show
Null Reference Exception. Try this:
private void bindimage()
{
if(Session["ss"] != null){
SqlDataAdapter adp = new SqlDataAdapter("select image from display where username=@us", con);
adp.SelectCommand.Parameters.AddWithValue("@us", Session["ss"].ToString());
DataSet ds = new DataSet();
adp.Fill(ds);
DataList2.DataSource = ds;
DataList2.DataBind();
}
else{
Response.Write("Session is null");
}
}
--Amit