Why does Cint ("1") fail?

I am trying to deploy a WinForms application in a Citrix environment. It worked reliably for some time on other physical and virtual machines, but does not work, only when the application is launched on the Citrix desktop.

Errors usually occur where we have mixed type data in the form of rows in the general-purpose parameter table in the database (SQL Server 2005), and then convert it to the corresponding type at run time.

So, for example, there is "1" in the database in the varchar (50) column, it is read, and then something like

dim myNumericVariable as integer = Cint(dr.Item(columnName))

(where dr is the DataRow exiting ADO.NET).

The exception that appears says:

Conversion from string "1" to type 'integer' is not valid

This type of failure occurs throughout the application, but only in the Citrix environment. It works fine in all our other environments, but I don’t know if the fact that it is Citrix is ​​just an accident, and there is one more reason.

This is a VB.NET, .NET 2.0 application, with Strict and Explicit, included, compiled for x86. It works great on XP SP3 as well as on Windows Server 2003 x64.

I am on my way with this - I all looked and did not find any hint on why I see this behavior. I would be very grateful for the suggestions. If you need more information about environments or how to create an application, I will gladly edit this question. Thanks in advance.

+3
source share
2 answers

; , .

+4

, 32- Vista, .

, Integer.Parse()?

Dim yourVar as Integer = Integer.Parse(dr.Item("YourColName").toString())
0

Source: https://habr.com/ru/post/1702179/


All Articles