客户端机器上的奇怪错误 [英] Weird Bug On Client Machine

查看:82
本文介绍了客户端机器上的奇怪错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


.Net 2.0

该程序在我的本地工作正常,但客户端机器上的输出是错误的。

由于问题只发生在客户端的机器上,我无法调试它。


本质上,程序从excell表中读取数据,进行一些处理,然后将结果输出到文本文件。

我将excel文件中的字符串转换为double和

1.23 - > 0.23 10.23 - > 0.23 11.23 - > 1.23 12.23 - > 2.23 149.10 - > 49.10

在客户的机器上。不幸的是0.24保持为0.24,与2.34等相同。

所以我在读完数据后无法修复数据。


我在想什么这个问题与客户在他们机器上的excel设置有关。


使用带连接字符串的OleDbConnection

@" Provider = Microsoft.Jet.OLEDB.4.0;数据源= {0};扩展属性= Excel 8.0;

我从我的工作表中选择*并填充我的数据集。


我很乏味,我不知道发生了什么...


有什么想法吗?


谢谢,

-Biff

Hello,

.Net 2.0
I am creating a windows forms application for deployment on a client''s machine.
The program works fine on my local but the output on the client machine is wrong.
Since the problem only occurs on the client''s machine I cannot debug it.

Essentially the program reads in data from an excell sheet, does some processing and then outputs to a text file the results.
I convert the strings from the excel file to doubles and
1.23 -> 0.23 10.23 -> 0.23 11.23 -> 1.23 12.23 -> 2.23 149.10 -> 49.10
on the client''s machine. Unfortunatly 0.24 stays as 0.24, same with 2.34 etc.
So I can''t fix the data after it has been read in.

I am thinking that this problem has something to do with the client''s excel settings on their machine.

Using an OleDbConnection with connection string
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0;"
I select * from my sheet and fill my dataset.

I''m flabberghasted, I have no clue what is going on...

Any ideas?

Thanks,
-Biff

推荐答案

我无法弄清楚你对这些数字做了什么。起初我虽然你只是拿小数点后面的部分,然后我以为你减去了10 ..然后我想也许你正在删除第一个数字。

它们似乎都不适合。


你可以尝试做的是,一半的程序读取excel表中的值,然后写出它认为它得到的文本文件(或者什么)然后写出来一个前后值,看看你能看到发生了什么吗?
I cannot figure out what you are doing to those numbers. At first I though you were just taking the portion after the decimal, then I thought you were subtracting 10..then I thought maybe you were removing the first digit.
None of them seemed to fit.

What you could try doing is, half the program read in the values from the excel sheet, and then write out what it thinks it got to a textfile (or whereever) and then write out a before and after value, see if you can see what is going on?



我无法弄清楚你对这些数字做了什么。起初我虽然你只是拿小数点后面的部分,然后我以为你减去了10 ..然后我想也许你正在删除第一个数字。

它们似乎都不适合。


你可以尝试做的是,一半的程序读取excel表中的值,然后写出它认为它得到的文本文件(或者什么)然后写出来之前和之后的值,看看你能看到发生了什么吗?
I cannot figure out what you are doing to those numbers. At first I though you were just taking the portion after the decimal, then I thought you were subtracting 10..then I thought maybe you were removing the first digit.
None of them seemed to fit.

What you could try doing is, half the program read in the values from the excel sheet, and then write out what it thinks it got to a textfile (or whereever) and then write out a before and after value, see if you can see what is going on?



感谢您的回复!

是的,它非常好看。据我所知,如果数字以1开头,它会被剪掉。

我的程序试图不对数字做任何事情。


在此期间我尝试将IMEX = 1添加到我的连接字符串中但结果是相同的。

Thanks for the reply!
Yeah it is pretty bizzare alright. As far as I can tell if the number starts with a 1 it is clipped off.
My program is trying to not do anything to the numbers hehe.

In the meantime I''ve tried adding IMEX=1 to my connection string but the results were the same.


所以如果你告诉你的数据集是WriteXML()(或者它是什么叫),它仍然缺少第一个字符?
So if you tell your dataset to WriteXML() (or whatever it was called), it still is missing the first character?


这篇关于客户端机器上的奇怪错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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