473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Sql Server 2005 Image Storage and Retreival

Hi,

I have a problem in the Image storing and retrieving at SQL Server 2005, my code is:

-----------------------------------------------------------------------------

for storing:

Image tempImg;

tempImg = (Image) picPhotograph.Image;


tempImg.Save(memBuffer, System.Drawing.Imaging.ImageFormat.Bmp);

bfrBuffer = new byte[memBuffer.Length];

memBuffer.Read(bfrBuffer, 0, (int)memBuffer.Length);

----------------------------------------------------------------------------

I am sending bfrBuffer using stored procedure to SQL server 2005, by when executing for storage, getting error as "Operand type clash: image is incompatible with varchar", I am using DBtype.binary (I can't able use SqlDbtype.Image, because my framework don't support) to assign bfrBuffer in the stored procedure parameter, I think here is the problem.

----------------------------------------------------------------------------

for retriving:

Image tempImg;

memBuffer.Write(bytEmployee, 0, bytEmployee.Length);

tempImg = Image.FromStream(memBuffer);

picPhotograph.Image = tempImg;

--------------------------------------------------------------------------

Here I am getting "parameter not valid" in the "tempImg = Image.FromStream(memBuffer);".

Can anybody help me.

Regards,

Nelson.
Sep 7 '06 #1
0 3278

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Michael Walton | last post by:
I need some help, because I am utterly confused with how to do this. I have 2 things that I need to figure out, and could use some sample code or just some general direction: 1) I need to build...
4
by: Kums | last post by:
Step 1: Write suspend for database. Connect to database. Issue the following command: db2 set write suspend for database Step 2: Create True Image Create a True Image of the required NAS...
7
by: gemel | last post by:
I am developing an application that uses SQL 2000 as my source of images. I have successfully created the code to load the images onto the SQL Server and also to retrieve the images into a dataset....
23
by: barryfz | last post by:
I need to be able to move from one web app on my server to another on the same server and preserve the session state. I have played with server.transfer but I get an error saying I can't do this....
1
by: ks | last post by:
HI is it possible to preload images to client browser directly from sql server without storing them on server space Have a nice day thanks in advance ks.
2
by: Connie | last post by:
We have a blob in one table that is storing pdf files. I need to write a select query that will grab that column and write those *.pdf files out to a location on my hard drive. Does anyone know...
0
Coldfire
by: Coldfire | last post by:
Since i cannot show the differences in a two-column like table. I am first putting MS SQL Server 2005 and then MySQL 5.x. MS SQL Server 2005 Brief Overview - SQL Server is a full-fledged...
2
by: samadams_2006 | last post by:
Hello, I have a problem that I'm hoping someone will be able to help me resolve. 1) I have a C# Web Site in which I connect to the database: "Install Microsoft SQL Server 2005 Express...
6
by: LordZyse | last post by:
Just so everyone can know, I would LOVE to stay with yellowtip webserver, if you know how to install the GD files to it PLEASE let me know. This php worked on my 4.x php server but I get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.