.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET 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 May 28th, 2002, 11:17 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
How to save images in an Access DB?

<i><b>Originally posted by : Ken Awamura (info@kencwb.com)</b></i><br />Hi, <br /><br />I´m trying to save an image to an Access Database using C#.<br /><br />1. The Db Table called 'Images' has the following fields : Id,Name,Data,ConType<br /><br />2. In order to get the atributes from the image file I´m using :<br /><br />//Get the file name from the upLoad textField<br />System.Web.HttpFileCollection colFiles = System.Web.HttpContext.Current.Request.Files; <br />System.Web.HttpPostedFile objCurrentFile = colFiles.Get(0); <br />System.String imgName = System.IO.Path.GetFileName(objCurrentFile.FileName );<br />//imgName will be something like : myImg.gif<br /><br />//Get the other attributes here<br />Stream imgStream = UploadFile.PostedFile.InputStream;<br />int imgLen = UploadFile.PostedFile.ContentLength;<br />byte[] imgBin = new byte[imgLen];<br /> int n = imgStream.Read(imgBin,0,imgLen);<br />string imgConType = UploadFile.PostedFile.ContentType;<br /><br /><br />Well, once I have all the attributes I need to save them in my Access Db.<br />I guess the ADO.NET part comes here, any ideas? <br /><br />Thanks, Ken<br />info@kencwb.com<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > How to save images in an Access DB?


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