Showing posts with label photos. Show all posts
Showing posts with label photos. Show all posts

Wednesday, March 28, 2012

Images in SQL Server 2005 Express

Hey all,

I'm working on a database which (I hope) will have photos in it. However, I'm having difficulty how to properly insert photos into an SQL database. I see that it has an 'image' data-type, but I don't know how to make proper use it.

Given that the answer to this question could be quite lengthy, if someone could provide me a link to somewhere, or a book to pick up that could answer this answer, I would be most gratified. Thanks!Smile [:)]

It is not that bad at all. Just convert your image to a ByteArray and it is ready to save.

Have a great day.

|||In general, I'm not a fan of storing images in the database directly. There just usually isn't any good reason to.

If you can, just store enough information in the database so you can find the image in question, and store the images on disk some place.

Monday, March 26, 2012

Images :: Next, Previous, First, Last Functionality

currently have my website that is functional...but would like to add some navigation to my photos which are displayed using a repeater tied to a SQL database. (live example can be viewed here)

the above link shows a gallery page that displays all the photos within a given shoot (using a querystring to display the unique ID of the photo shoot). When you click on one of the images within the shoot a page called is called displaying the selected photo by passing the shoot ID and the unique ID of the photo itself through a querystring.

I would like to add navigation to the page displaying the photo that would allow the user to go to the next photo, previous photo, first and last phot within the specific SHOOT ID.

First
Next
Previous
Last

I am using a repeater to display the photo with the following sqlDataSource:

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:Connection %>"
SelectCommand="
SELECT usr_Photos.*, usr_PhotoShoot.*
FROM usr_Photos
INNER JOIN usr_PhotoShoot ON usr_Photos.Shoot_ID = usr_PhotoShoot.Shoot_ID
WHERE usr_Photos.Photo_ID = @.ID AND usr_Photos.Shoot_ID = @.Shoot">

<SelectParameters>
<asp:QueryStringParameterDefaultValue=""Name="ID"QueryStringField="ID"/>
<asp:QueryStringParameterDefaultValue=""Name="Shoot"QueryStringField="Shoot"/>
</SelectParameters>

</asp:SqlDataSource>

I am having trouble figuring out a way to add the functionality i would need to change photos within the specific photo shoot without having to go back to the gallery page. any help or ideas you could point me in would be great...thanks in advance...

You need Datalist or Repeater Control Coustom Paging.

see the live view of what we created:

http://www.friendspoint.de/UsersWidPics.aspx

You will be able to find alot of material online for that. just google for "Datalist paging"

Did it help? If still not then i will try to post some Article.

|||

Ok, the Article is just finished. you can see it here now:

http://www.dotnet-friends.com/articles/asp/artinasp0cfb304d-42ea-4f8b-b480-9c047396252e.aspx

Friday, March 23, 2012

Image not displayed in report

Hello everyone,

I have a Reporting Services report which must show photographs stored in a SQL Server database. The trouble is that the photos just don't display. The report just shows the little red cross icon.

When I use MS-Access forms and reports it works fine. But I need this to work with Reporting Services!

Help please!

Jerome

What data type are the pictures stored in SQL DB? You may want to change the MIMEType of the Image control on your report to see if which one is correct. I've been using image/bmp to accommodate pictures stored as varbinary data type. HTH.|||

Hi.

I discovered that the problem has to do with the way Access stores images. It stores all the OLE data necessary to display the images in Access, but this is not compatible with SQL Server. I solved the problem by purchasing and installing DBPix software. It cost me US$ 100.

Cheers,

Jerome

|||

Technet has an article about how to access OLE images. See the section entitled 'Task List Item 2 – Database Images' in http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/migratereports.mspx. Note that the code as presented only works for OLE images created on an en-US system:

Code Snippet

=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields.Picture.Value),105))

For images created on other locales, check out this post: http://forums.devarticles.com/showpost.php?p=51707&postcount=3.

Thanks.

Image not displayed in report

Hello everyone,

I have a Reporting Services report which must show photographs stored in a SQL Server database. The trouble is that the photos just don't display. The report just shows the little red cross icon.

When I use MS-Access forms and reports it works fine. But I need this to work with Reporting Services!

Help please!

Jerome

What data type are the pictures stored in SQL DB? You may want to change the MIMEType of the Image control on your report to see if which one is correct. I've been using image/bmp to accommodate pictures stored as varbinary data type. HTH.|||

Hi.

I discovered that the problem has to do with the way Access stores images. It stores all the OLE data necessary to display the images in Access, but this is not compatible with SQL Server. I solved the problem by purchasing and installing DBPix software. It cost me US$ 100.

Cheers,

Jerome

|||

Technet has an article about how to access OLE images. See the section entitled 'Task List Item 2 – Database Images' in http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/migratereports.mspx. Note that the code as presented only works for OLE images created on an en-US system:

Code Snippet

=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields.Picture.Value),105))

For images created on other locales, check out this post: http://forums.devarticles.com/showpost.php?p=51707&postcount=3.

Thanks.