473,385 Members | 1,309 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,385 software developers and data experts.

Parseint in vb.net?

Please tell me how do we use parseint function or its equivalent in
vb.net.
And also tell me how do we hide and display controls during run-time
in vb.net? I need to access the rows of a table for rendering them
during run-time.

Feb 14 '07 #1
2 17614
On Feb 14, 7:49 am, "Garg" <shivaniga...@gmail.comwrote:
Please tell me how do we use parseint function or its equivalent in
vb.net.
There are two functions:
Integer.parse(stringWithNumber) which returns an integer but throws an
exception if the string is not a number.

The other one, which I recommend, is Integer.tryParse, use it like
this:
Dim outNumber as Integer
If not Integer.tryParse(stringWithNumber, outNumber) Then
outNumber = defaultValue
End If
----

If stringWithNumber is not parseable as an Integer outNumber is set to
0.

Feb 14 '07 #2
Thanks a lot Henrik!!
I was kinda stuck there...since am new to vb.net

Feb 14 '07 #3

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

Similar topics

5
by: Jeff Thies | last post by:
I've noticed that doing: var x=any number between -1 and 1, like 0.5 parsInt(x) yields NaN. I was expecting zero. Is there another way of doing this?
9
by: Henrik | last post by:
In Java you can write something like this. Does anyone know how to do this in javascript? "byte b=Integer.parseInt(int value or String).byteValue;"
14
by: jacster | last post by:
Hi, I'm trying to parse a string of the form 08:00 representing a time so I can calculate the difference between two times. parseInt(time) with a leading zero returns 0. Is there a way around...
6
by: RobG | last post by:
I am writing a script to move an absolutely positioned element on a page by a factor using style.top & style.left. The amount to move by is always some fraction, so I was tossing up between...
25
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does parseInt('09') give an error? ----------------------------------------------------------------------- ...
14
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does K = parseInt('09') set K to 0? ----------------------------------------------------------------------- ...
12
by: kilik3000 | last post by:
Why does parseInt("0000000000000018") return 1, while parseInt("0000000000000018", 10) return 18? My assumption was that the base 10 would be default argument for radix. Wouldn't you want to...
6
by: lorlarz | last post by:
Regarding http://mynichecomputing.com/digitallearning/yourOwn.htm and how to make it fail when it should not with an integer OR parseInt to integer conversion problem. THE real problem IS is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.