Help needed with SQL CE

T

tiger79

Ok, first of all I'd like to know if this statement is true :

The basic integer data type can handle data values ranging
from -2,147,483,638 through 2,147,483,647

in SQL i mean...

And is there some limit in the number of rows in a CE database ???

Because i'm trying to read in a database which has 2 tables. One with 4
columns and like 80 rows, the second has 4 columns and about 39000 rows.
When I try to fill the databse I get the following error :
System.Data.SqlServerCe.SqlCeError : The data is truncated

so I guess or that i'm using too big of a number to be contained in the int
field, or I'm using too big of a string in the nvarchar field ??? So what is
bigger than int in SQL ??? Thought I saw bigint somewhere but I just cant
seem to find it :(

thanx...
 
T

tiger79

I found what my problem is...
I'm sending some variables to my database : some integers and some string...
Now I've seen that if theres a ' character the problem will arise... (like
in people's) people would work but because of the ' character it wont... any
idea on how to solve this porlem ???
 
C

Chris J.T. Auld [MVP]

use double ' in the sql statement.
something like '... people''s ...'

Or better still use parameterised queres... That way you get a performance
boost if you run the same query twice.
Tkae a look at
http://samples.gotdotnet.com/quickstart/CompactFramework/doc/sqlceparameterizedquery.aspx

Cheers
Chris

--
****Please Reply To The Newsgroup So All Can Benefit From Discussion****
-------------------------------------------
Kognition Consulting Limited - Thought Meets Technology
Chris J.T. Auld - Managing Director
Microsoft MVP (Windows Mobile Devices)
Phone: +64 3 453 0064
Mobile: +64 21 500 239
Email: (e-mail address removed)
news:%[email protected]...
 
T

tiger79

I tried that last advice, and now it passes the data without bothering for
the ' char....
problem now is that after it inserted around 200 records it gives me an
error : Not enough storage available to complete the operation...
Well, then i gave it more storage via the Settings-Storage-Memory but that
won't help...
The strange thing is that it blocked the first time when the database was
68k, then i runned it again so that it started placing the same values in
the same database and then when te error came up the size was 164k ???
So, what is the problem here ???
 
S

Syed N. Yousuf [MS]

Try in a smaller app to see if that works. If it is a low virtual address
space issue, you may review the memory dump by using the sample in the
following Knowledge Base article.

326164 Dumpmem Utility for Viewing Virtual Address Space on Pocket PC 2002
http://support.microsoft.com/?id=326164

You can access SQL Server CE Knowledge Base articles at:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO
( select ' SQL Server CE ' as the product )

Thank you!
Syed N. Yousuf
Microsoft Developer Support Professional

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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