Re: Unabl to insert byte into database
Posted by: latha mad
Date: October 30, 2006 06:01PM

latha mad Wrote:
-------------------------------------------------------
> Hello everyone,
>
> I have problem inserting byte in to dtaabse. When
> byte array is inserted into database it gives an
> error saying that the syntax is wrong. but i
> followed the same syntax specified in mysql
> manual. What could be the problem? This is the
> code i use.
>
> FileStream mystream1 =
> File.Open("image.xml",FileMode.Open);
>
> int filesize = (int)mystream1.Length;
> byte[] rawdata=new byte;
> mystream1.Read(rawdata, 0, filesize);
> try
> {
>
> Connectionclass.OdbcCom = new
> System.Data.Odbc.OdbcCommand();
> Connectionclass.OdbcCom.Connection
> = Connectionclass.OdbcCon;
>
> Connectionclass.OdbcCom.CommandText="insert into
> Pattern_desc (byte_stream,file_size,Length,Width)
> values("+rawdata+","+filesize+",10, 20)";
> }
> catch (exception e)
> {
> }
>
> Can someone please help me?
>
> Thank you,
> Latha


----------------------------------
And the database i created is
Create table Pattern_desc(byte_stream blob, filesize INT,Length INT, Width INT);

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

Options: ReplyQuote


Subject
Written By
Posted
Re: Unabl to insert byte into database
October 30, 2006 06:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.