473,320 Members | 1,876 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,320 software developers and data experts.

How to Store image in SQLCE database for .NET2005 using C# smart device applications

Hi,

I have a very hard time to insert Image into Sqlce Database.

Table : Test
Column : mypic
Datatype : image

below the code while i am inserting

signFile.txt is already captured image's conversion into txt file


FileStream stream = new FileStream("\\SignFile.txt", FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(stream);

byte[] photo = reader.ReadBytes((int)stream.Length);
reader.Close();
stream.Close();


SqlCeCommand cmd = new SqlCeCommand("INSERT INTO Test (mypic) " +
" VALUES (@mypic)", conn);

cmd.Parameters.Add("@mypic", SqlDbType.Image, photo.Length).Value = photo;

conn.Open();
cmd.ExecuteNonQuery();
conn.Close();


While i am doing it's giving an error that "There was an error parsing the query.[Toekn line no, Token line offset....] "

Can any one help me with this???
Thanks in advance.
Feb 25 '09 #1
0 2904

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

Similar topics

21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
4
by: Enver A | last post by:
Hey ppl, I am having trouble in building a smart device application. I cant create a table on SQLCE server using this line. Anyone can tell me what the problem is? I am able to create another 3...
3
by: samsam | last post by:
I have installed visual studio.net 2003 and now how can i get the SDE??? I found resources stating that the SDE is within the VS.net 2003 and others say that it exists as an add-in and that it...
2
by: Jeff | last post by:
Please note this is NOT a rant or complaint! And yes, I'm over-simplifying, but intentionally. Here goes... With ASP.NET Web applications I like that I can access data from anywhere without...
0
by: Rod | last post by:
I orginally posted this to microsoft.public.sqlserver.ce but had not received any responses. I have a CF.NET application (C#) with a SqlCE database. We had originally planned to use SQL...
5
by: Titeuf | last post by:
ok I start programming mobile application with VB.NET (VS 2005) I am interested work with Sqlce Also I look for add reference in my project I search "System.Data.SqlServerCe" but not found....
0
by: drgoon | last post by:
I have a mobile app using sqlce 2.0 connecting to an sql 2000 server db. I am able to push, pull and execute sql statements no problem. I would like to be able to "sniff" messages and data going...
0
by: Jamesbond890 | last post by:
Hi all I have Visual studio 2003 with just c# installed I have to read in a access database and show it using the smart device application. I sort of know how to do it on a normal app but as soon...
2
by: archanapriya | last post by:
HI, Iam new to .net . I want to know the uses of smart device applications and real time examples of smart device applications, can any one help me out asap,plzzzz
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.