Click here to Skip to main content
14,270,386 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi sir this is view page?
string constr = ConfigurationManager.ConnectionStrings["CONSTR"].ConnectionString;
private int id = 0;

protected void Page_Load(object sender, EventArgs e)
id = Convert.ToInt32(Request.QueryString["id"].ToString());
if (!IsPostBack)


private void BindControlvalues()
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand("select * from tbl_addnewproduct where id=" + id, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
Image1.ImageUrl = ds.Tables[0].Rows[0][1].ToString();
Label1.Text = ds.Tables[0].Rows[0][2].ToString();
Label2.Text = ds.Tables[0].Rows[0][3].ToString();


*****this is gridview page********
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

        DataSourceID="SqlDataSource1" Width="237px">
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False"

                ReadOnly="True" SortExpression="id" />
             <asp:TemplateField HeaderText="Image">
                         <img alt ="" src ='images/<%#Eval("imagename") %>' height="50px" width="50px" />

<a href ='<%#"viewdeatil.aspx?id="+DataBinder.Eval(Container.DataItem,"id") %>'> <%#Eval("Name") %>  </a>
            <asp:BoundField DataField="product" HeaderText="product"

                SortExpression="product" />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"

        ConnectionString="<%$ ConnectionStrings:BussinessConnectionString %>"

        SelectCommand="SELECT [id], [imagename], [Name], [product] FROM [tbl_addnewproduct]">

i want to show the gridview image in next page after click view button
but above code working but image is not show;
thanks sir
Updated 18-Oct-14 0:45am
/\jmot 20-Oct-14 5:31am
what's the error?

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100