Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i made a c# prodject that uses System.Data.SqlServerCe to create a sdf which I then copy to a ce5.0 device.

This works fine in xp but when I run the same project in windows 7 i get weard errors. PLEEEEESE HELP!!!!!!!!!!!!!!!!!!

1st : I had to change the name of one of the tables as the sql on the device cant recognise a table with a numeric in it ie:
ryanstable works
ryanstable1 doesnt work.
If the sdf is created with the app running in xp the device reads ryanstable1 fine.

2nd : if i write a select satement on the devices sql query editor or from the devices mobile project i cant use '' .eg:

select * from table where name = 'ryan' returns nothing but
select * from table where name = ryan returns the result.
If the sdf is created with the app running in xp the device executes the first select statement fine.

The device and xp applications has been working for years. Create a sdf in xp with a c# program then copy to the device then the mobile device has app that uses select statements. client now has a windows 7 machine and the desktop app creates sdf but mobile device cant use it.
Posted

The first problem is the table is almost corrupt if it has a digit in it. On the mobile devices sql mangager you can see the table name but cant edit or see the columns. Im not to worried about that though as I just changed the table name to something without a digit,I included it as I thought the problems may be related. My major consern is the second problem.

I have now discoved that i can do a querie like
select * from table where name = 'ryan'
it returns a result if the column isnt indexed.
also if I delete the index through the devices sql querie editor and re-create it, the statement works.

It seems when win 7 is creating the sdf the index is created funny.
The reason why i just dont leave out the inverted commas is
if i leave them out (select * from table where name = ryan)
and it doesnt find any thing it takes like 20 sec to return nothing found.

If it does find a row then it returns in about 0.5 seconds.
I need to create the index with the sdf on the desktop as the mobile device takes to long to index all rows.
 
Share this answer
 
For the first problem try this:
select * from [ryanstable1]

For the second problem look into quoted identifiers:
http://www.sommarskog.se/dynamic_sql.html#QUOTED_IDENTIFIER[^]


I guess the default options aren't the same on your windows 7 machine and therefore give errors that weren't there on xp. You could also check those out and look for differences there.

Good luck!
 
Share this answer
 
Comments
SytheZN 4-Aug-10 4:59am    
Reason for my vote of 1
Not an answer
ryan17 4-Aug-10 10:35am    
Reason for my vote of 1
please see post below

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900