xp上的c#应用程序使sdf(工作)在Windows 7上相同的exe(设备不能使用制成的sdf) [英] c# app on xp makes sdf (works) same exe on windows 7 (device cant use the sdf made)

查看:103
本文介绍了xp上的c#应用程序使sdf(工作)在Windows 7上相同的exe(设备不能使用制成的sdf)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我制作了一个使用System.Data.SqlServerCe创建CSD的C#产品,然后将其复制到ce5.0设备中.

这在XP中可以正常工作,但是当我在Windows 7中运行相同的项目时,会出现磨损错误. PLEEEEESE帮助!!!!!!!!!!!!!!!!!!

1st:我必须更改表之一的名称,因为设备上的sql无法识别其中包含数字的表,即:
ryanstable作品
ryanstable1不起作用.
如果使用在xp中运行的应用程序创建了sdf,则该设备将读取ryanstable1很好.

第二:如果我在设备sql查询编辑器上或从设备移动项目中写了一个选择区,则不能使用''''.例如:

从表中选择*,其中name =" ryan"只会返回
从name = ryan返回结果的表中选择*.
如果使用在xp中运行的应用程序创建了sdf,则设备将执行第一个select语句fine.

设备和xp应用程序已经运行了多年.使用C#程序在xp中创建一个sdf,然后将其复制到设备,然后移动设备具有使用select语句的应用程序.客户端现在具有Windows 7计算机,并且桌面应用程序创建了sdf,但移动设备无法使用它.

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.

推荐答案

第一个问题是,如果该表具有里面的数字.在移动设备sql管理员上,您可以看到表名,但不能编辑或查看列.我不担心这一点,尽管我只是将表名更改为没有数字的东西,但由于我认为问题可能是相关的,所以我将其包括在内.我的主要问题是第二个问题.

我现在发现我可以做
的查询 从表中选择*,其中name =" ryan"
如果该列未索引,则返回结果.
另外,如果我通过设备sql querie编辑器删除索引并重新创建它,则该语句有效.

似乎当win 7创建sdf时,索引创建起来很有趣.
我不遗漏逗号的原因是
如果我将其保留(从名称= ryan的表中选择*)
并没有发现任何东西,例如需要20秒才能返回未找到的任何东西.

如果找到行,它将在约0.5秒后返回.
我需要在桌面上用sdf创建索引,因为移动设备需要很长时间才能索引所有行.
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.


对于第一个问题,请尝试以下操作:
从[ryanstable1]中选择*

对于第二个问题,请查看带引号的标识符:
http://www.sommarskog.se/dynamic_sql.html#QUOTED_IDENTIFIER [
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!


这篇关于xp上的c#应用程序使sdf(工作)在Windows 7上相同的exe(设备不能使用制成的sdf)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆