My Table looks like
Table Name: Categories
CategoryID : int
CategoryName: text
Description: text
Picture: Image
Now I want to display all these fields in a DataGrid.
I have done this,
DataGrid1.DataSource = DataTable or DataView;
DataGrid1.DataBind();
<asp:DataGrid ID="DataGrid1" runat="server" AutoGenerateColumns="False"
Width="100%">
<Columns>
<asp:BoundColumn DataField="CategoryID" HeaderText="Category ID" />
<asp:BoundColumn DataField="CategoryName" HeaderText="Category Name" />
<asp:BoundColumn DataField="Description" HeaderText="Description" />
<asp:TemplateColumn HeaderText = "Picture">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
I'm facing problem in binding the image. All other columns are fine.