in database table is thier . in that table fields are
photoid , photoname,photo... i want display image in the
gridview

Answer Posted / .....

initially while inserting image into database take the
database field in oracle as BLOB in sql as image

during insertion convert the image file into bytes and
insert it into the database

during the display of image in datagrid take a image
template and display the converted values
sample code to get the image:
public byte[] spic(string cm,int id)
{
con = new OracleConnection(cm);
OracleCommand cmd = new OracleCommand("select
photo from kir_image where eid= "+id +" ", con);
con.Open();
byte[] img = (byte[])cmd.ExecuteScalar();
con.Close();
return img;
}

use Response.BinaryWrite to display the image

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who can consume WebAPI?

757


Why we go for mvc instead of asp.net? : Asp.Net MVC

706


Explain the features that make asp.net more used framework? : asp.net mvc

685


What is active web pages?

689


How does session work in asp net?

753


How to prepare culture-specific formatting in .net.

740


What does aspcompat="true" mean?

754


What are the events that happen when a client requests an asp.net page from iis server?

682


What is the default timeout for a cookie?

768


Why asp.net is used?

737


Explain the components of web form in asp.net

751


What are the ways of preserving data on a Web Form in ASP.NET?

811


What parameters can you pass in the url of the api? Can get and post use the same url?

736


Explain managed code an un-managed code.

771


What is the difference between dynamic SGA and static SGA?

791