Sample.aspx
Sample.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lblsession.Text = "Welcome" + Convert.ToString(Session["UName"]);
sessionimage();
}
}
private void sessionimage()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ConnectionString);
try
{
string UName = (string)Session["UName"];
SqlDataAdapter Adp = new SqlDataAdapter("select Photo from TBL_PBLogin where UName='"+ UName +"'", con);
DataTable Dt = new DataTable();
con.Open();
Adp.Fill(Dt);
gridviewphoto.DataSource = Dt;
gridviewphoto.DataBind();
con.Close();
}
catch (Exception ex)
{
throw new Exception(ex.ToString());
}
}
DataBase:
EmpID PrimaryKet(1,1)
UName varchar(50),
Password varchar(50),
Photo image
Getting an ERROR: The User photo not displaying
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Abhay ShankerPosted May 19, 2015, 5:19 AM
Gowtham RajamanickamPosted May 19, 2015, 4:23 AM