|
-
Jan 1st, 2014, 04:32 AM
#1
Thread Starter
Junior Member
retrieving images from a remote computer
i have develop an application which make use of Microsoft SQL Sever 2008. i store data in this database and store location of images in a table in the database. The application get the location of the image from the database and display the images. but when i use the application on a different computer other than where the database is installed the images wont display, because the images are not at the current location on the computer. is it advisable to store the pictures as bits in the database and retrieve it remotely if not then how can i get over this. i connect to the database remotely
-
Jan 1st, 2014, 05:12 AM
#2
Re: retrieving images from a remote computer
It's often said that storing images and other large binary objects in a database is inadvisable because it makes the data file much larger and therefore less efficient. That is indeed true but later versions of SQL Server have provided a solution to that issue. If you can enable the FILESTREAM feature of the instance then you can write your application to save the binary data directly to the database, just as you would with any other data, but SQL Server will actually store the data external to the MDF file, keeping it lean and mean.
Alternatively, if you want to keep doing things the way you are, you can create a network share on that machine and then use the UNC path of that share as the root of your file path. That way, any machine on the network will be able to retrieve the file using the same path.
I'd recommend the first option as the better of the two but it may be that you can implement the second option with basically no code changes.
-
Jan 1st, 2014, 05:18 AM
#3
Re: retrieving images from a remote computer
I'd recommend the first option as the better of the two
I would complete agree. Why create a remote connection only to require shared resources?
In your case it sounds like you have stored the image location that is referenced to the db server. If so, and if you retrieve the location of the image on any other machine it would certainly fail
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Jan 2nd, 2014, 07:56 AM
#4
Thread Starter
Junior Member
Re: retrieving images from a remote computer
Thank you very much using Filestream did the magic, but i have one problem when you call a normal delete on a row the images are still on disk how can i delete them. DO i have to
create a sub to delete them myself.
-
Jan 2nd, 2014, 08:50 AM
#5
Re: retrieving images from a remote computer
http://technet.microsoft.com/en-us/l...QL.105%29.aspx
When a FILESTREAM field is set to NULL, the BLOB data associated with the field is deleted.
When you delete a row or delete or truncate a table that contains FILESTREAM data, you delete the underlying BLOB data in the file system.
It would appear that you don't have to do anything beyond a normal database operation to delete the data.
-
Jan 5th, 2014, 09:52 AM
#6
Thread Starter
Junior Member
Re: retrieving images from a remote computer
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|