SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 3rd, 2002, 10:03 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Using images in a database

<i><b>Originally posted by : Tim Brewin (tbrewin@hotmail.com)</b></i><br /><br />Hello,<br /><br />I am developing an ASP driven application as part of a university project. The site is basically a gallery to display photos for various artists. There is a database that store details such as names and addresses and the like and also the actual images that make up the exhibitions. I have made the basic site navigation using Dreamweaver and thats fine. I am now working on the ASP side of things. I'm using Drumbeat to do the design for this which seems to work fine despite being a bit old. The database is built in Access 2000.<br /><br />I can get the basic text information in and out of the database which is OK but am having problems displaying the images and letting people add new images to the database. I'm sure this is just a simple thing but I would appreciate any help anyone has to offer me. Especially anyone who has experience with drumbeat.<br /><br />Thanks in advance,<br /><br />Tim

Reply With Quote
  #2  
Old April 4th, 2002, 06:54 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Peter (peter_crabb@ntlworld.com)</b></i><br />Hi,<br /><br />I have the same issue. I can obtain the binary data in the feil but this does not just include the jpg. The binary data is wrapped as a OLE Object.<br /><br />Have you managed to solve the problem?<br /><br />If this a help, this is how I got the binay data out (below sorry about the formatting)<br /><br />Pete<br /><br /><br />//imports and stuff<br />void Page_Load()<br />{<br /> string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;";<br /> strConnection += @"Data Source= " + Server.MapPath("..\db\images.mdb");<br /> <br /> string strSQL = "SELECT PicKey, Picture FROM Images WHERE PicKey=1";<br /><br /> OleDbConnection objConnection = new OleDbConnection(strConnection);<br /> OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);<br /> OleDbDataReader objDataReader = null;<br /> <br /> try<br /> {<br /> objConnection.Open();<br /> objDataReader = objCommand.ExecuteReader();<br /> <br /> while(objDataReader.Read())<br /> {<br /> con_close.Text = "the data type = " + objDataReader.GetDataTypeName(0);<br /> //Response.BinaryWrite((byte[]) objDataReader["Picture"] );<br /> }<br /> <br /> objDataReader.Close();<br /> objConnection.Close();<br /> }<br /> catch (Exception e)<br /> {<br /> //TO DO: Suggest the a black small image with exeption is generated<br /> }<br />}<br /></script><br /><html><br /> <body><br /> <h4><br /> Reading data from the connection<br /> </h4><br /> <asp:label id="con_close" runat="server" /><br /> <br><br /> </body><br /></html><br /><br /><br />Hello,<br /><br />I am developing an ASP driven application as part of a university project. The site is basically a gallery to display photos for various artists. There is a database that store details such as names and addresses and the like and also the actual images that make up the exhibitions. I have made the basic site navigation using Dreamweaver and thats fine. I am now working on the ASP side of things. I'm using Drumbeat to do the design for this which seems to work fine despite being a bit old. The database is built in Access 2000.<br /><br />I can get the basic text information in and out of the database which is OK but am having problems displaying the images and letting people add new images to the database. I'm sure this is just a simple thing but I would appreciate any help anyone has to offer me. Especially anyone who has experience with drumbeat.<br /><br />Thanks in advance,<br /><br />Tim

Reply With Quote
  #3  
Old May 3rd, 2002, 04:27 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : sreedhar (balerao_s@yahoo.com)</b></i><br />Hi,<br /><br />I would sujjest keeping all the images in a different relative directory and access images using the relative path, stored in the database.<br /><br />you can easily add images to the directory and adding a relative path in the database.<br /><br />Hope this solves your problem.<br /><br />------------<br />Peter at 4/4/2002 4:54:03 AM<br /><br />Hi,<br /><br />I have the same issue. I can obtain the binary data in the feil but this does not just include the jpg. The binary data is wrapped as a OLE Object.<br /><br />Have you managed to solve the problem?<br /><br />If this a help, this is how I got the binay data out (below sorry about the formatting)<br /><br />Pete<br /><br /><br />//imports and stuff<br />void Page_Load()<br />{<br /> string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;";<br /> strConnection += @"Data Source= " + Server.MapPath("..\db\images.mdb");<br /> <br /> string strSQL = "SELECT PicKey, Picture FROM Images WHERE PicKey=1";<br /><br /> OleDbConnection objConnection = new OleDbConnection(strConnection);<br /> OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);<br /> OleDbDataReader objDataReader = null;<br /> <br /> try<br /> {<br /> objConnection.Open();<br /> objDataReader = objCommand.ExecuteReader();<br /> <br /> while(objDataReader.Read())<br /> {<br /> con_close.Text = "the data type = " + objDataReader.GetDataTypeName(0);<br /> //Response.BinaryWrite((byte[]) objDataReader["Picture"] );<br /> }<br /> <br /> objDataReader.Close();<br /> objConnection.Close();<br /> }<br /> catch (Exception e)<br /> {<br /> //TO DO: Suggest the a black small image with exeption is generated<br /> }<br />}<br /></script><br /><html><br /> <body><br /> <h4><br /> Reading data from the connection<br /> </h4><br /> <asp:label id="con_close" runat="server" /><br /> <br><br /> </body><br /></html><br /><br /><br />Hello,<br /><br />I am developing an ASP driven application as part of a university project. The site is basically a gallery to display photos for various artists. There is a database that store details such as names and addresses and the like and also the actual images that make up the exhibitions. I have made the basic site navigation using Dreamweaver and thats fine. I am now working on the ASP side of things. I'm using Drumbeat to do the design for this which seems to work fine despite being a bit old. The database is built in Access 2000.<br /><br />I can get the basic text information in and out of the database which is OK but am having problems displaying the images and letting people add new images to the database. I'm sure this is just a simple thing but I would appreciate any help anyone has to offer me. Especially anyone who has experience with drumbeat.<br /><br />Thanks in advance,<br /><br />Tim

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Using images in a database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT