字符串加倍 [英] string to double

查看:64
本文介绍了字符串加倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vb.net 2005中创建了一个应用程序。它在我的机器上工作正常。我测试了几台不同的测试机,一切正常。至于客户端,它正在产生错误。我的应用程序从excel表读取并将值导入oracle数据库。生成的错误是:从类型字符串转换为类型double无效。为什么它只在客户端的计算机上而不是我的计算机上生成?

I created an application in vb.net 2005. It works fine on my machine. I tested several different test machines and all were working fine. As for the client, it''s generating an error. My application reads from an excel sheet and imports the values to an oracle database. the error being generated is: "conversion from type string to type double is not valid". Why is it generating only on the client''s computer and not mine?

推荐答案

@dandalero


您可以发布执行此操作的代码吗?


Steven
@dandalero
Can you post the code that does this?

Steven


Dim deci As Decimal = 0

deci = CDec (dt.Rows(i).Item(13))


如果不是IsDBNull(dt.Rows(i).Item(13))AndAso deci> 0然后

.price = CDec(dt.Rows(i).Item(13))

结束如果


POITEM .price = .price
Dim deci As Decimal = 0
deci = CDec(dt.Rows(i).Item(13))

If Not IsDBNull(dt.Rows(i).Item(13)) AndAlso deci > 0 Then
.price = CDec(dt.Rows(i).Item(13))
End If

POITEM.price = .price


它是否与机器上的区域设置有关?这通常会在例如0,13和0.13。


Steven
Could it have something to do with the regional settings on the machines? This often creates a difference between e.g. 0,13 and 0.13.

Steven


这篇关于字符串加倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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