本文介绍了为什么图片未显示在网页中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么图像未显示在网页中.路径在textbox3中加注.
我的CS编码在下面给出
Why the image is not displaying in the web page.The path is fatched in textbox3.
My cs Coading is given below
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;
}
}
推荐答案
Image1.ImageUrl = dRow.ItemArray.GetValue(2).ToString();
这篇关于为什么图片未显示在网页中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!