C# School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a C# Expert!

Join 307,084 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 2,268 people online right now. Registration is fast and FREE... Join Now!




image not showing in image field

 

image not showing in image field, i have a gridview there are three field like,ID,image,Name and also a

er.omprakash

3 Aug, 2009 - 02:04 AM
Post #1

New D.I.C Head
*

Joined: 2 Sep, 2008
Posts: 4

i have a gridview there are three field like,ID,image,Name and also a link print in gridview . retrieve all record from database showing in Gridview i have done it.but when i click link buttion in gridview then show all record


HTML code:

<tr bgcolor="#f2f2f2" class="black">
<td height="25" style="width: 15px"> </td>
<td ><div align="left">ID*: </div></td>
<td style="text-align: left" id="ct" runat="server" ></td>
<td> </td>
</tr>

<tr bgcolor="#f2f2f2" class="black">
<td height="25" style="width: 15px"> </td>
<td ><div align="left">name : </div></td>
<td style="text-align: left" id="fname" runat="server" ></td>
<td> </td>
</tr>
<asp:Image ID="Image1" Width="120" Height="120" runat="server" ImageAlign ="Middle" />


cSharp page Code i have do

protected void Page_Load(object sender, EventArgs e)
{
conn = new SqlConnection("data source=(local);uid=sa;pwd=sa;initial catalog=databasename");


cmd = new SqlCommand("select name,ID,impimg from tablename where ID='" + Request.QueryString.Get("id") + "'");

cmd.Connection = conn;
conn.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{

fname.InnerHtml = dr["name"].ToString();
ct.InnerHtml = dr["ID"].ToString();
Image1.ImageUrl = dr["impimg"].ToString();


}
}

two record dislaying but Image not display .
i want show one by one record when click print buttion please help me.

Attached File  omprakash.txt ( 1.7k ) Number of downloads: 6


User is offlineProfile CardPM
+Quote Post


Ändrew

RE: Image Not Showing In Image Field

3 Aug, 2009 - 03:32 AM
Post #2

D.I.C Head
Group Icon

Joined: 21 Apr, 2008
Posts: 232



Thanked: 10 times
Dream Kudos: 75
My Contributions
Are you sure the image is exitsting?
User is offlineProfile CardPM
+Quote Post

er.omprakash

RE: Image Not Showing In Image Field

18 Aug, 2009 - 01:42 AM
Post #3

New D.I.C Head
*

Joined: 2 Sep, 2008
Posts: 4

[quote name='er.omprakash' date='3 Aug, 2009 - 02:04 AM' post='723341']
i have a gridview there are three field like,ID,image,Name and also a link print in gridview . retrieve all record from database showing in Gridview i have done it.but when i click link buttion in gridview then show all record


HTML code:

<tr bgcolor="#f2f2f2" class="black">
<td height="25" style="width: 15px"> </td>
<td ><div align="left">ID*: </div></td>
<td style="text-align: left" id="ct" runat="server" ></td>
<td> </td>
</tr>

<tr bgcolor="#f2f2f2" class="black">
<td height="25" style="width: 15px"> </td>
<td ><div align="left">name : </div></td>
<td style="text-align: left" id="fname" runat="server" ></td>
<td> </td>
</tr>
<asp:Image ID="Image1" Width="120" Height="120" runat="server" ImageAlign ="Middle" />


cSharp page Code i have do

protected void Page_Load(object sender, EventArgs e)
{
conn = new SqlConnection("data source=(local);uid=sa;pwd=sa;initial catalog=databasename");


cmd = new SqlCommand("select name,ID,impimg from tablename where ID='" + Request.QueryString.Get("id") + "'");

cmd.Connection = conn;
conn.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{

fname.InnerHtml = dr["name"].ToString();
ct.InnerHtml = dr["ID"].ToString();
Image1.ImageUrl = dr["impimg"].ToString();


}
}

two record dislaying but Image not display .
i want show one by one record when click print buttion please help me.

1- yes image in database and showing in Gridview

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 10:41AM

Live C# Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month