473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

convert string to int32

45 New Member
Hi All,

How to convert string value to int32.

In timsplit i have value "17:00 - 2:00".Then i am converting it TimeIn and TimeOut.TimeIn is string now and how to convert it to int32.I am getting error while convertin

Timesplit = strResultData.S plit('-');
string TimeIn = Timesplit[0];
string TimeOut = Timesplit[1];
int TimeI = Int32.Parse(Tim eIn);
Sep 27 '10 #1
3 1900
mzmishra
390 Recognized Expert Contributor
u r getting error b'coz your Timein value is 17:00 .u have a ":" .what exactly u r trying to do?
Sep 27 '10 #2
NareshN
45 New Member
Hi,

I want to store this 17:00 into integer variable which i will insert into database column.17:00 is TimeIn for employee
Sep 27 '10 #3
Frinavale
9,735 Recognized Expert Moderator Expert
An Integer is a "whole number"...
For example
-1 is an integer
0 is an integer
1 is an integer
2 is an integer
...
1000 is an integer

However, 17:00 is not an integer.
It is a Time value. You cannot store time into an Integer. If you want to store the Time then use a DateTime type instead of an Integer type.

-Frinny
Sep 27 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2736
by: Nathan | last post by:
Is there a way to convert a string to a CipherMessage? I am calling a function that decrypts a CipherMessage and returns the value. The only problem is when I want to use an encrypted value stored in a querystring, I can't figure out how to convert it back to a CipherMessage.
3
27550
by: news.hku.hk | last post by:
could you tell me how can i convet a string to integer?? #include <iostream> #include <string> using namespace std; int main(){ int integer; string buffer("123456789");
3
2369
by: winthux | last post by:
How can I convert string i.e. to integer or to unsigned integer, or to other types?
3
3438
by: Petr Jakes | last post by:
Hi, I am trying to convert string to the "escaped string". example: from "0xf" I need "\0xf" I am able to do it like: a="0xf" escaped_a=("\%s" % a ).decode("string_escape") But it looks a little bit complicated in this beautiful language to me .....
5
12700
by: XML newbie: Urgent pls help! | last post by:
function to convert string to 1 dimensional array of long in VB.Net
3
7973
by: Ursula | last post by:
Is it possible to convert a string in a file. The problem is this: I have an object string that is a file xml and I want to pass to Deserialize function, but Deserialize function expect an object of FileStream type and the mode access. There is a function Convert.ChangeType(object value, Type conversionType), but I cant write for example:...
3
9879
by: Shawn Ferguson | last post by:
Hello All, I'm trying to do what I would think would be simple and straightforward, but it is not. I have a 2 textbox on a form, a label, and a button, when I click the botton I want to add the 2 textboxes and place the value in the label. Unfortunately, when I try to convert.Int32(txtBox1.Text) I get cannot convert string to int error. ...
4
17336
by: Man4ish | last post by:
HI , I am trying to convert string into char array of characters.but facing problem. #include <iostream> #include <string> using namespace std; int main() { string t="1,2,3,4,5,6";
12
13518
by: Peter | last post by:
Trying to convert string to byte array. the following code returns byte array of {107, 62, 194, 139, 64} how can I convert this string to a byte array of {107, 62, 139, 65} System.Text.UTF8Encoding str = new System.Text.UTF8Encoding(); string s = new string((char)107, 1); s += new string((char)62, 1);
9
8233
by: engteng | last post by:
How do I convert string to numeric in VB.NET 2003 ? Example convert P50001 to 50001 or 50001P to 50001 but if P is in middle then not convert. Regards, Tee
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.