I'm trying to put a img
that I receive in Blob
format within a cell
of Gridview
, I convert it to url by the following method:
cmd1 = new OracleCommand();
cmd1.Connection = conn1;
cmd1.CommandText = "select * from simbolos_ll";
string url = null;
try
{
OracleDataReader dr = cmd1.ExecuteReader();
while (dr.Read())
{
if (dr["idsimb"].ToString().Equals(id))
{
OracleCommand cmd2 = new OracleCommand();
cmd2.Connection = conn1;
cmd2.CommandText = "select simbolo from simbolos_ll where idsimb=" + id;
OracleDataReader dr2 = cmd2.ExecuteReader();
dr2.Read();
OracleLob blob = null;
blob = dr2.GetOracleLob(0);
byte[] bytes = (byte[])blob.Value;
string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
url = "data:image/png;base64," + base64String;
}
}
once I have the url of the img
, I want to put it between a text of cell
of a Gridview
.
My problem is that I do not know how to make Text1
+ Img
+ text2
appear in the same cell of the Grid View.
Any idea or tutotial where I can look how to do it?
Annotations:
-The GridView
is filled with a query different from the one I get the Img
.
-The Img
depends on a data that has been marked within a string
of one of the cells of the Gridview
.