Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rlangi05
Starting Member
3 Posts |
Posted - 2008-09-11 : 02:33:10
|
Hi all,I need some advice on a particular problem. Here's the situation:I have a database (sql server 2000) with a table, let's call it tblTable. In tblTable there is a field called Image1 of datatype varchar and this field contains the path of images stored in the files system.I want to create a web service (.NET 2.0) that will query get data from tblTable including the actual images and not the image path. The web service will have a function that gets the data and returns a dataset which contains the image. This image will then be saved into another database (not in the file system but in the database itself).In the database that contains tblTable, how can I return the actual image as part of select query. The query will be in a stored procedure and will be called by the webservice to populate a dataset.Thanks in advance |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-09-11 : 02:38:01
|
if your webservice gets the paths to the images from the SQL Server, it can easily get at the bytes of the file using apis in the System.IO namespace. elsasoft.org |
 |
|
rlangi05
Starting Member
3 Posts |
Posted - 2008-09-11 : 03:49:12
|
quote: Originally posted by jezemine if your webservice gets the paths to the images from the SQL Server, it can easily get at the bytes of the file using apis in the System.IO namespace. elsasoft.org
How about if the web service resides in another server than the database? |
 |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-09-11 : 10:40:54
|
that works fine. what's important is the web service needs access to the server where the images reside.Are you storing the paths as UNC or local paths in the db? my suggestion only works well if UNC. elsasoft.org |
 |
|
rlangi05
Starting Member
3 Posts |
Posted - 2008-09-12 : 02:56:41
|
quote: Originally posted by jezemine that works fine. what's important is the web service needs access to the server where the images reside.Are you storing the paths as UNC or local paths in the db? my suggestion only works well if UNC. elsasoft.org
what's saved is the relative path in relation to the application root path. example: "/Folder1/Pic123.jgp" |
 |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-09-14 : 17:36:27
|
then you can make that root path a network share, give the web service perms to read from the share, and the web service will be able to open the files using System.IO methods. elsasoft.org |
 |
|
|
|
|