|
List Info
Thread: RE: Error displaying images in gridview
|
|
| RE: Error displaying images in gridview |
  United States |
2008-04-18 04:28:24 |
Why not store the image in the file system?
On Apr 18, 2008, at 3:21, "dipak mishra"
<mishradipak gmail.com> wrote:
Dear Allen,
I am storing Image itself in database not the path to it.
How to display that using image field.
I am not able to do so.
Plz Help
On 4/18/08, Allen Moon <howlmoon clearwire.net> wrote:
Hey there
In ASP 2.0 there is a ImageField in gridview that you need
to use.
-----Original Message-----
From: dipak mishra [mailto:mishradipak gmail.com]
Sent: Thursday, April 17, 2008 1:15 PM
To: aspnet-databases aspadvice.com
Cc: aspnet-databases aspadvice.com
Subject: [aspnet-databases] Error displaying images in
gridview
Hi All,
I am facing a problem on which i would like to have
suggestions.
I have an ERP Application in ASP.net 2.0 with sql 2005 as
back end. I am
storing images in database then i am displaying it on a page
and giving the
URL of that page in grid view template field which has a
image control.
Same thins i have been doing in application developed in asp
1.0 and sql 7.0
the images are displayed correctly everywhere.
But in this application in Grid view the same image have
stopped being
displayed. Although if i view them individually on other
page they are
displayed correctly.
The client has genuine sql server.with service pack 2. Same
things are
working fine on my development machine and similar thing is
running fine in
asp 1.0 and sql 7.0.
It was running fine on this clients system too. All of a
sudden this is not
displaying image in grid view.
I have reinstalled sql2005 still same problem.
The images are saved in sql 2005 this i have checked also
the images are
displayed correctly individually which proves images are in
fact saved
actually.
Any help will be graetly appreciated since i am stuck
Regards
Dipak
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
____________________________________________________________
________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9
tAcJ
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
|
|
| RE: Error displaying images in gridview |
  United States |
2008-04-18 07:15:15 |
|
you'd need a query string for a path that points to a page with a primary key. the page should do a read out of the database and do a binary write with a mime type of jpg or whatever.
(FetchImage.aspx page)
Sub Page_load(...)
dim pk as Integer = Request.QueryString("pk")
- set the mimetype of the output (Response.ContentType="application/jpg"
Try
- connect to database
- initializeCommand to call stored procedure and return datatable
- read the 'bits' out of the field into a byte array
- check if bytearray.length = 0 or datatable.rows.count = 0
- response.Binarywrite(byteArray)
Catch Ex As Exception
-send 'error.jpg' file
End Try
Grid
in the RowDataBound event, if the row is a datarow then initialize the column with the hyperlink control path point to the fetchimage.aspx?pk = " & e.item.DataItem("PK")
You can look up how to read the binary bits from a database if you google.
> Date: Fri, 18 Apr 2008 02:28:24 -0700 > From: MKamoski Yahoo.com > Subject: [aspnet-databases] RE: Error displaying images in gridview > To: aspnet-databases aspadvice.com > > Why not store the image in the file system? > > > On Apr 18, 2008, at 3:21, "dipak mishra" <mishradipak gmail.com> wrote: > > Dear Allen, > I am storing Image itself in database not the path to it. > How to display that using image field. > I am not able to do so. > Plz Help > > On 4/18/08, Allen Moon <howlmoon clearwire.net> wrote: > Hey there > In ASP 2.0 there is a ImageField in gridview that you need to use. > > -----Original Message----- > From: dipak mishra [mailto:mishradipak gmail.com] > Sent: Thursday, April 17, 2008 1:15 PM > To: aspnet-databases aspadvice.com > Cc: aspnet-databases aspadvice.com > Subject: [aspnet-databases] Error displaying images in gridview > > Hi All, > I am facing a problem on which i would like to have suggestions. > I have an ERP Application in ASP.net 2.0 with sql 2005 as back end. I am > storing images in database then i am displaying it on a page and giving the > URL of that page in grid view template field which has a image control. > Same thins i have been doing in application developed in asp 1.0 and sql 7.0 > the images are displayed correctly everywhere. > But in this application in Grid view the same image have stopped being > displayed. Although if i view them individually on other page they are > displayed correctly. > The client has genuine sql server.with service pack 2. Same things are > working fine on my development machine and similar thing is running fine in > asp 1.0 and sql 7.0. > It was running fine on this clients system too. All of a sudden this is not > displaying image in grid view. > I have reinstalled sql2005 still same problem. > The images are saved in sql 2005 this i have checked also the images are > displayed correctly individually which proves images are in fact saved > actually. > Any help will be graetly appreciated since i am stuck > Regards > Dipak > > > > Need SQL Advice? http://sqladvice.com > Need RegEx Advice? http://regexadvice.com > Need XML Advice? http://xmladvice.com > > > > > Need SQL Advice? http://sqladvice.com > Need RegEx Advice? http://regexadvice.com > Need XML Advice? http://xmladvice.com > > > > > Need SQL Advice? http://sqladvice.com > Need RegEx Advice? http://regexadvice.com > Need XML Advice? http://xmladvice.com > > > > Need SQL Advice? http://sqladvice.com > Need RegEx Advice? http://regexadvice.com > Need XML Advice? http://xmladvice.com > > > > Need SQL Advice? http://sqladvice.com > Need RegEx Advice? http://regexadvice.com > Need XML Advice? http://xmladvice.com > > > Need SQL Advice? http://sqladvice.com > Need RegEx Advice? http://regexadvice.com > Need XML Advice? http://xmladvice.com > > > > ____________________________________________________________________________________ > Be a better friend, newshound, and > know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ > > > Need SQL Advice? http://sqladvice.com > Need RegEx Advice? http://regexadvice.com > Need XML Advice? http://xmladvice.com
Going green? See the top 12 foods to eat organic.
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
|
[1-2]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|