473,320 Members | 2,161 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,320 software developers and data experts.

about data type convert

How can I convert a string data type to a int data type.
Nov 16 '05 #1
2 1239
You want to use int.Parse(string);

e.g.

string s = "12345";
int i = int.Parse(s);

--
Steve Willcock, MCSD
http://www.willcockconsulting.com/

"authorking" <au************@hotmail.com> wrote in message
news:eE*************@TK2MSFTNGP09.phx.gbl...
How can I convert a string data type to a int data type.

Nov 16 '05 #2
Hi,

Int.Parse() will rise an exception if the string parameter is not
convertible to an integer, you will have to wrap it on a try/catch

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Steve Willcock" <st***@N-O-S-P-A-Mwillcockconsulting.com> wrote in message
news:cf*******************@news.demon.co.uk...
You want to use int.Parse(string);

e.g.

string s = "12345";
int i = int.Parse(s);

--
Steve Willcock, MCSD
http://www.willcockconsulting.com/

"authorking" <au************@hotmail.com> wrote in message
news:eE*************@TK2MSFTNGP09.phx.gbl...
How can I convert a string data type to a int data type.


Nov 16 '05 #3

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

Similar topics

0
by: gagans | last post by:
Hi My web service has a method which accepts byte array as parameter. <WebMethod()> _ Public Function SendLoan(ByVal data As Byte()) As String Dim filePath As String filePath =...
1
by: Asaf Ganot | last post by:
Hi, I'm looking for a way to retrieve the date type of a registry value using c#. Since I couldn't find a way to do it with 'Microsoft.Win32', I tried to use the good old API call 'RegEnumValue'...
4
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
Hey, Well, I have a Problem. I have designed a table which has few fields which are being declared in the database of type .... char of length 10. and other fields with varchar 50 and...
2
by: Robert Smith jr. | last post by:
Hello, Please pardon my newbie question ... I am building an ASP.NET page that displays a recordset with a Delete statement enabled (this all works fine). I want to Insert the current row...
23
by: Steven T. Hatton | last post by:
This is one of the first obstacles I encountered when getting started with C++. I found that everybody had their own idea of what a string is. There was std::string, QString, xercesc::XMLString,...
6
by: SQL Server | last post by:
I've been working this for a while. Kind of new to SQL Server functions and not seeing what I am doing wrong. I have this function CREATE FUNCTION dbo.test (@Group varchar(50)) RETURNS...
1
by: neeraj | last post by:
Hi All Can any give me the code for convert "DataColumn" data type of "DataTable". Even if data table already populated (have data) Actually I am creating one search module which searches the...
10
by: colin | last post by:
Hi, I profile my code and find its spending a lot of time doing implicit conversions from similar structures. the conversions are mainly things like this class Point { implicit conversion...
160
by: raphfrk | last post by:
Is this valid? int a; void *b; b = (void *)a; // b points to a b += 5*sizeof(*a); // b points to a a = 100;
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.