Hey guys,
In Access table I mad a new column with the type OLE Object and then in the row of the table I added 3 pictures into it and one from a file which is stored as package as the final picture.
Then I did the approriate table relationship so that the package appears in the column/row in ACCESS table.
In my project this is what I added in the datagrid
<asp:TemplateField HeaderText="Log">
<ItemTemplate>
<asp:Image ID="idLog" runat="server" ImageUrl='<%#"~/" + DataBinder.Eval(Container.DataItem, "Icon") %>'> </asp:Image>
</ItemTemplate>
</asp:TemplateField>
In the ASP.NET side this is what I added
Private Sub Bind_Data()
Using con As New OleDbConnection(ConfigurationManager.ConnectionStrings("TestLocal").ConnectionString)
Dim cmd As New OleDbCommand("SELECT tblWorkOrderItem.WorkOrderItemID, tblWorkOrderItem.bffGrade AS Item, tblWorkOrderItem.Quantity AS Qty, tblWorkOrderItem.Description, tblWorkOrderItem.Note, tblIcons.Icon FROM (tblWorkOrderItem INNER JOIN tblWorkOrder ON tblWorkOrderItem.[WorkOrderID] = tblWorkOrder.[WorkOrderID]) INNER JOIN tblIcons ON tblWorkOrderItem.IconType = tblIcons.ID WHERE [tblWorkOrderItem].[WorkOrderID]=@ID", con) With {.CommandType = CommandType.Text}
Dim myParamCollection As OleDbParameterCollection = cmd.Parameters
Dim myParam As OleDbParameter = myParamCollection.Add(New OleDbParameter("ID", OleDbType.Integer))
myParam.Value = Convert.ToInt16(Session("ID"))
' Dim myICounter As OleDbParameter = myParamCollection.Add(New OleDbParameter("iCounter", OleDbType.Integer))
' myICounter.Value = 0
Dim selectResults As New DataSet()
Dim ole_DBAdapter As New OleDbDataAdapter(cmd)
ole_DBAdapter.Fill(selectResults)
con.Open()
If cmd.ExecuteReader.HasRows Then
GridView1.DataSource = selectResults
GridView1.DataBind()
End If
con.Close()
End Using
End Sub
However it shows only this in the datagrid no matter what I do, any help please?
