I want to save image to sql database by through insert query butwithout using SqlParameter

C

Chetana

Hi ,
I have sucessfully stored image into database and retrived also .I
have done it by using SQLParameter and then added that parameter to
sqlcommand .

But can i do it by using insert query .Means I have taken one image
property and assign it to byte array which has all the data of image .

I have used this

Suppose i have byte[] imagedata;

and propertimagedata is also of type image .

propertimagedata=(Image)imagedata;

and i want to save propertimagedata in insert query but above is
giving me error.

So if anyone has any idea reply me.
 
C

Cowboy \(Gregory A. Beamer\)

The problem here is turning a byte array into a query. Your query is text,
while the byte array is not. I am not sure how to overcome this issue, but I
would personally use the parameterized method, as it is a good practice.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top