Hi Tevin,
Please below refer sample
HTML
C#
<asp:Repeater ID="rptTblFiles" runat="server">
<HeaderTemplate>
<table>
<tr>
<th>Id</th>
<th>Name</th>
<th>Image</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label Text='<%#DataBinder.Eval(Container.DataItem,"id")%>' runat="server" ID="lblid" />
</td>
<td>
<asp:Label Text='<%# DataBinder.Eval(Container.DataItem,"Name") %>' runat="server" ID="lblName"></asp:Label>
</td>
<td>
<img class="img-rounded" alt='<%# Eval("Name") %>' src='data:image/jpg;base64,<%# Convert.ToBase64String((byte[])Eval("Data")) %>' height="200" width="150" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
VB.Net
<asp:Repeater ID="rptTblFiles" runat="server">
<HeaderTemplate>
<table>
<tr>
<th>Id</th>
<th>Name</th>
<th>Image</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label Text='<%#DataBinder.Eval(Container.DataItem,"id")%>' runat="server" ID="lblid" />
</td>
<td>
<asp:Label Text='<%# DataBinder.Eval(Container.DataItem,"Name") %>' runat="server" ID="lblName"></asp:Label>
</td>
<td>
<img class="img-rounded" alt='<%# Eval("Name") %>' src='data:image/jpg;base64,<%# Convert.ToBase64String(CType(Eval("Data"), Byte())) %>' height="200" width="150" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Namespace
C#
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
VB.Net
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.BindGrid();
}
}
private void BindGrid()
{
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(conString))
{
using (SqlCommand cmd = new SqlCommand("tblFiles_GettblFiles", con))
{
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
this.rpTtblFiles.DataSource = cmd.ExecuteReader();
this.rptTblFiles.DataBind();
con.Close();
}
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Me.BindGrid()
End If
End Sub
Private Sub BindGrid()
Dim conString As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Using con As SqlConnection = New SqlConnection(conString)
Using cmd As SqlCommand = New SqlCommand("tblFiles_GettblFiles", con)
cmd.CommandType = CommandType.StoredProcedure
con.Open()
Me.rptTblFiles.DataSource = cmd.ExecuteReader()
Me.rptTblFiles.DataBind()
con.Close()
End Using
End Using
End Sub