Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why the image is not displaying in the web page.The path is fatched in textbox3.


My cs Coading is given below

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Data;


public partial class Retrive_Data_From_Database_and_display_in_TextBox : System.Web.UI.Page
{
    OleDbConnection con;
    OleDbCommand com;
    OleDbDataAdapter da;
    DataSet ds;
    protected void Page_Load(object sender, EventArgs e)
    {
        con = new System.Data.OleDb.OleDbConnection();
        ds = new DataSet();
        con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/kamnagroup.mdb") + "";
        string sql = "select aname,add1,photo,point from joining WHERE point=(SELECT MAX(point) FROM joining)";
        da = new System.Data.OleDb.OleDbDataAdapter(sql,con);
        con.Open();
        da.Fill(ds,"joining");
        navigatedata();
        con.Close();
        con.Dispose();
    }
    private void navigatedata()
    {
        DataRow dRow=ds.Tables["joining"].Rows[0];
        
        TextBox1.Text = dRow.ItemArray.GetValue(0).ToString();
        TextBox2.Text = dRow.ItemArray.GetValue(1).ToString();
        TextBox3.Text = dRow.ItemArray.GetValue(2).ToString();
        TextBox4.Text = dRow.ItemArray.GetValue(3).ToString();
        Image1.ImageUrl = TextBox3.Text;
        
    }
}
Posted
Updated 24-Jan-12 22:45pm
v2

1 solution

assign the url directly:

C#
Image1.ImageUrl = dRow.ItemArray.GetValue(2).ToString();
 
Share this answer
 
Comments
Janardan Pandey 25-Jan-12 5:01am    
still not showing image in the web page

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900