Hi
I have top banner in my application which will show an image and i am using "location" session so first page of application allow user to chosse his country and then redirect him to the selected country page. what i am looking for to show each image on the spacific page depending on session. Here is my server code which is not working and the image its not appear
protected void Topbannerimgbtn_Click(object sender, EventArgs e)
{
var location = Convert.ToString(Session["location"]);
using (SqlConnection topbanner = new SqlConnection(sc))
{
topbanner.Open();
SqlDataAdapter DAtopban = new SqlDataAdapter("Select advimg from Adverttop WHERE ([Country] = @Country)", sc);
DataSet DStopban = new DataSet();
DAtopban.SelectCommand.Parameters.AddWithValue("@Country", location);
DAtopban.Fill(DStopban);
bannertoplstviw.DataSource = DStopban.Tables[0];
bannertoplstviw.DataBind();
}
}
and here is aspx code:
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Guest UserRank #259 · 9.8K reputationPosted Jul 7, 2014, 10:22 PM EDT
Session["location"] variable?
Can you share that piece of code also?
twitter @sumitjolly
Khan Abrar AhmedRank #778 · 3K reputationPosted Jul 14, 2014, 11:26 PM EDT
http://www.c-sharpcorner.com/UploadFile/a20beb/retrieve-image-from-the-database-in-Asp-Net/
Abhishek JaiswalRank #126 · 17.5K reputationPosted Jul 15, 2014, 12:19 AM EDT
CHECK OUT THIS ARTICLE:
http://www.c-sharpcorner.com/UploadFile/a20beb/retrieve-image-from-the-database-in-Asp-Net/
:)