Solved

Image Default value to varbinary(max)

Posted on 2011-02-22
3
953 Views
Last Modified: 2012-06-27
Hello, i want to have an image as default value in my varbinary(max) column.

But the data in a varbinary(max) is encrypted <binary data> :S
0
Comment
Question by:bskyum
  • 2
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 34958702
I would, for that, create a row that holds the default value, and "on insert" trigger, update the current row with the value of that default "image".
<binary data> is btw not encrypted, but the interface does not display "binary data", as it cannot know that the data is actually an image.
0
 
LVL 14

Assisted Solution

by:robasta
robasta earned 250 total points
ID: 34958709
That would be duplicating the default image. I would suggest that you do a check when you get the image, if the Image (varbinary field) is empty, get the default image from somewhere else (file system or a particular row in db).

The other advantage is that you can cache the 'default' image and avoid getting the same data from the database.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34958742
good food for thought, robasta.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Round up to 100% in .NET 10 79
How to LOAD up a .NET Framework website with data? 2 39
c# string handling 1 26
Eagerly loading related objects in entity framework 5 23
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now