I want to save image to sql database by through insert query but

I want to save image to sql database by through insert query but

am 21.01.2008 14:05:09 von 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.

Re: I want to save image to sql database by through insert query but without using SqlParameter

am 21.01.2008 16:13:39 von NoSpamMgbworld

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!
|
*************************************************
"Chetana" wrote in message
news:b2382620-3bd2-4c93-b6fc-027089207df1@n20g2000hsh.google groups.com...
> 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.