Solved

how to display image in a bounded grid (to access .mdb) on a web page ???

Posted on 2007-03-30
13
235 Views
Last Modified: 2012-06-27
Hello

My problem is this:
I am using Dreamweaver 8 to build a pesonnal web site. I added a page that will display thumbnails and of course when you clic you get big picture. pretty standard so far...

But I do not want to read file. instead I want to just upload a access file and read from the database...

I have build a dome using a dataviewgrid in a C# project (.exe) with visual studio 2005 and I fugured I could do the same and re-use the same logic on a datagrid in a web page.

So I created a web site in visual studio 2005 and added a grid and a data source... but now I cannot get the bitmap field to be displayed in the grid cell! I see all the text but no images :(

Is there a simpler way? some control that binds to a ado or oledb available out there? Or is there a better way to do this? I figure uploading a .mdb file is much simpler that sending a bunch of .jpg files! But how to do this????

once the visual studio page is done I will simply add it to the dreamweaver site and it should work ;) but I need help being sucha newby at web stuff!!!

thanks
0
Comment
Question by:aquila98
  • 6
  • 5
13 Comments
 
LVL 25

Expert Comment

by:Rouchie
ID: 18823107
The gridview contains a field called the ImageField.  DW probably won't know it exists because it does not support ASP.NET very well, and certainly not ASP.NET 2.0 whatsoever.

Within the gridview's <columns> tags, add this line:

  <asp:imagefield datafield="myDataBaseImageFieldName" headertext="Picture" />

Obviously substituting "myDataBaseImageFieldName" with the correct name from your database field.

Here's a site with a working C# example - http://authors.aspalliance.com/aspxtreme/sys/web/ui/webcontrols/demos/gridviewimagefield.aspx
0
 
LVL 2

Author Comment

by:aquila98
ID: 18823264
exactly what I want...
except how can I get this to work thare is lots of stuff missing, where is this class fetchData_oledb.cs documented? I guess this is the data fetcher class from the access file... do you know where I can get a complete VS 2005 solution to better understand how the pieces work together?

but it is a great start, I'll try to integrate into my existing VS 2005 web site

thanks for the link
0
 
LVL 2

Author Comment

by:aquila98
ID: 18823347
the datafield is not part of the asp:imagefield... i used DataImageUrlField instead... but does not seems to work :(
0
 
LVL 25

Expert Comment

by:Rouchie
ID: 18823353
fetchData_oledb.cs will be the class that particular website is using to hide the database logic from readers.  Don't worry that - what's important is getting the ImageField created in the GridView, and pulling the data through into it.

If you've already got the database connection set up, just add the new gridview column and see what happens - ASP.NET should do the rest for you!
0
 
LVL 25

Expert Comment

by:Rouchie
ID: 18823472
>> i used DataImageUrlField instead... but does not seems to work :(

Okay I see your confusion. Before I go on I should just make sure that the images themselves are not stored in the database, just the file names, correct?

If so, now you've specified the image's file name, you need to specify the path

<asp:imagefield dataimageurlfield="dataBaseFieldName"  dataimageurlformatstring="~\Images\{0}.jpg"  />
0
 
LVL 2

Author Comment

by:aquila98
ID: 18823500
in fact, the image data is stored in the database file.
I have a VS2005 c# application that build the access database with the actual .jpg and a reduce thumbnail for each row of the database. Then I upload the .mdb filr to the web site and the page should display the thumbnail in a grid. When the user clic a thumbnail it display a detailview with the actual picture and metadata taken from the database. not url and no .jpg files are uploaded to the website...

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 25

Expert Comment

by:Rouchie
ID: 18823579
Ahh okay, well then this approach won't work without modification.  I've not used your approach before, but I believe you need to create a sub that converts the raw data into an image.

You might have to Google the display of images from a database, but this page has a sample:

http://www.syncfusion.com/FAQ/aspnet/WEB_c27c.aspx#q567q
http://www.codeproject.com/cs/database/images2db.asp
0
 
LVL 2

Author Comment

by:aquila98
ID: 18823683
first solution is close... but the grid would have to open a connection for each row and worse it savec the image to a file...

if there was a way to generate the urldynamically to fool the grid into thinking that the data is from a file but instead package it from a stream ...
something like http://getpicturedatafromdatabase.aspx?pictureidfromgrid then I could use the <asp:imagefield dataimageurlfield=...

have you seen such code anywhere?

I'll google, thanks for help!
0
 
LVL 25

Expert Comment

by:Rouchie
ID: 18823722
No I haven't I'm afraid, and DW certainly won't help you.  You really need to be using VS2005 (I use the free Web Developer version).

You could try posting a link in the ASP.NET topic area.  I'm sure one of those Experts will know how to solve it.
0
 
LVL 25

Expert Comment

by:Rouchie
ID: 18823728
Ah sorry I didn't realise you had cross-posted.  I'm sure someone will help soon enough... :-)
0
 
LVL 2

Author Comment

by:aquila98
ID: 18829220
I have found a working solution...
I build a webcontrol using a sample provided by msdn (wickedcode056) and I converted the field in the grid to a template. Then I edited the template and replaced the label control with a webcontrol to display the image and behold it worked!

thanks anyway for your hints.
0
 
LVL 1

Accepted Solution

by:
kodiakbear earned 0 total points
ID: 18854453
Closed, 125 points refunded.
kb
Experts Exchange Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
The goal of the tutorial is to teach the user what gradient filters are and how to use them. When you have a photo and some part of the photo is either over exposed or under exposed, you use a gradient filter to help mask the need to touch up th…
The goal of the tutorial is to teach the user how to make his/her own presets while editing so it is easier to edit there photos. Create a preset you like and copy that setting then save it in to your presets folder.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now