473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

casting not working on host machine

What follows works fine on my localhost when I test it but migrating to my
web host gives me an error
The line of code is:
poly1a.employeeID = CInt(TextBox1.Text)

The error message is "Input string was not in a correct format."

1. have option strict on
2. The employeeID is a property defined as an integer
3. Caste the textbox1.text as integer

Any help would be appreciated



Nov 21 '05 #1
2 803
Barry,

This can when there is a non numeric value (which may include currency
signs, comma's, decimal points and numeric representations) in your textbox.

So the simplest test before this is
\\\
IF IsNumeric(TextBox1.Text) then
///
I hope this helps?

Cor
Nov 21 '05 #2
"barry" <fl******@ix.netcom.com> schrieb:
What follows works fine on my localhost when I test it but migrating to my
web host gives me an error

The line of code is:
poly1a.employeeID = CInt(TextBox1.Text)

The error message is "Input string was not in a correct format."


\\\
Imports System.Globalization
..
..
..
Dim i As Integer
Dim d As Double
If _
Double.TryParse( _
Me.TextBox1.Text, _
NumberStyles.Integer, _
Nothing, _
d _
) _
Then
i = CInt(d)
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Harry | last post by:
Hi ppl Some problem regarding pointer: ULONG *addr; CHAR *ptr=NULL; addr=new ULONG; //calling a function and getting the addr value //ULONG is 4 bytes. I am getting the Ip address which...
1
by: rahul8143 | last post by:
hello, In kernel source code there is ip_fragment.c file my question is regarding pointer function and casting for that look at required snippet from that file There is structure defined for...
4
by: Richard | last post by:
All, I have coded an Outlook automation Addin in C# and .NET. I created the project using the Extensibility wizard. The Addin installs and runs Ok on my machine. However I am unable to...
2
by: Zac | last post by:
Alright anyone who has 2c throw it in... I am working through a custom xml serializer and have come upon a conundrum, given our class design. The interface implemented on the base class (base...
6
by: Chakkaradeep | last post by:
hi all, I have written a C# Service which is a Server accepting Clients,It is working fine when i connect from localhost but when i connect from any other machine to my machine , the service is...
8
by: Hardy Wang | last post by:
Hi: Is it possible for me to create/open web application from remote machine other than port 80? And create application directly under virtual web site instead of creating a virtual directory?...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine running IIS 6.0. I just replaced the web.config and several aspx pages in the application and now the style sheets are not working. the images from the themes work but not the css...
6
by: josequinonesii | last post by:
I've searched, I've read, I've tested and re-read numerous post but to no avail yet... Quite simply, the settings I've applied to my httpd.conf, httpd-vhost.conf and my hosts files simply does not...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.