[/code] 图片 [url=http://www.freeimagehosting.net/image.php?5f48d79f6e.png]http://www.freeimagehosting.net/image.php?5f48d79f6e.png[/url] [img]http://www.freeimagehosting.net/uploads/th.5f48d79f6e.png" /> [/code] 图片 [url=http://www.freeimagehosting.net/image.php?5f48d79f6e.png]http://www.freeimagehosting.net/image.php?5f48d79f6e.png[/url] [img]http://www.freeimagehosting.net/uploads/th.5f48d79f6e.png">

佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1325|回复: 2

aspx gridview

[复制链接]
发表于 11-11-2010 06:55 PM | 显示全部楼层 |阅读模式
做么我看不到图片的?

  1.   <form id="form2" runat="server">
  2.     <asp:GridView ID="GridView2" AllowSorting="True" AllowPaging="True" runat="server" DataSourceID="SqlDataSource1"
  3.       AutoGenerateColumns="False">
  4.       <Columns>
  5.         <asp:BoundField HeaderText="Title" DataField="imgTitle" SortExpression="imgTitle" />
  6.         <asp:ImageField HeaderText="Image"  DataImageUrlField="imgData" ReadOnly="True"  ItemStyle-Width="30" ItemStyle-Height="50"/>
  7.         <asp:BoundField HeaderText="Date" DataField="imgDate" SortExpression="imgDate" />
  8.           <asp:ButtonField CommandName="Delete" HeaderText="Delete" ShowHeader="True"
  9.               Text="Delete" />
  10.       </Columns>
  11.     </asp:GridView>
  12.        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
  13.       SelectCommand="SELECT [imgTitle], [imgData], [imgDate] FROM [imgDB_Temp]"
  14.       ConnectionString="<%$ ConnectionStrings:ConnectionASPX %>" />
  15.   </form>
复制代码





图片
http://www.freeimagehosting.net/image.php?5f48d79f6e.png
回复

使用道具 举报


ADVERTISEMENT

发表于 16-11-2010 11:12 PM | 显示全部楼层
回复 1# pσtεtσ-ζх

你的IMAGE STORE 在DATABASE。
可以POST SQL SCRIPT 吗?
或许你可以REFER TO 以下的LINK 了解如何RETRIEVE IMAGE FROM DATABASE AND DISPLAY ON GRIDVIEW。

http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx

http://www.asp.net/data-access/tutorials/displaying-binary-data-in-the-data-web-controls-vb
回复

使用道具 举报

 楼主| 发表于 15-12-2010 05:16 PM | 显示全部楼层
<form id="form2" runat="server">
    <asp:GridView ID="GridView2" AllowSorting="True" AllowPaging="True" runat="server" DataSourceID="SqlDataSource1"
      AutoGenerateColumns="False">
      <Columns>
        <asp:BoundField HeaderText="Title" DataField="imgTitle" SortExpression="imgTitle" />
        <aspmageField HeaderText="Image"  DataImageUrlField="imgData" ReadOnly="True"  ItemStyle-Width="30" ItemStyle-Height="50"/>
        <asp:BoundField HeaderText="Date" DataField="imgDate" SortExpression="imgDate" />
          <asp:ButtonField CommandName="Delete" HeaderText="Delete" ShowHeader="True"
              Text="Delete" />
      </Columns>
    </asp:GridView>
       <asp:SqlDataSource ID="SqlDataSource1" runat="server"
      SelectCommand="SELECT [imgTitle], [imgData], [imgDate] FROM [imgDB_Temp]"
      ConnectionString="<%$ ConnectionStringsonnectionASPX %>" />
  </form>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 18-11-2025 02:27 PM , Processed in 0.122435 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表