ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Microsoft Related >> ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions (614)
 C Sharp interview questions  C Sharp Interview Questions (721)
 ASP.NET interview questions  ASP.NET Interview Questions (1442)
 VB.NET interview questions  VB.NET Interview Questions (150)
 COM+ interview questions  COM+ Interview Questions (41)
 ADO.NET interview questions  ADO.NET Interview Questions (198)
 IIS interview questions  IIS Interview Questions (86)
 MTS interview questions  MTS Interview Questions (5)
 Crystal Reports interview questions  Crystal Reports Interview Questions (62)
 BizTalk interview questions  BizTalk Interview Questions (33)
 Dot Net interview questions  Dot Net Interview Questions (861)
 Exchange Server interview questions  Exchange Server Interview Questions (103)
 SharePoint interview questions  SharePoint Interview Questions (25)
 WCF interview questions  WCF Interview Questions (8)
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions (193)
Question
How to convert a string into an Integer in ASP.net?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 1
by two ways u can do that
1.

int a = Int.Parse("String");

2.

int a = Convert.Int32("String");
 
Is This Answer Correct ?    96 Yes 17 No
Guest
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 2
we can do this way also
int intA=Convert.ToInt32("string");
 
Is This Answer Correct ?    45 Yes 21 No
Deva
 
 
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 3
int A = CInt("String") i think this is the best way 
Is This Answer Correct ?    24 Yes 7 No
Bhaskar
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 4
works only if the input is integer 
Is This Answer Correct ?    15 Yes 11 No
Kiran
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 5
Good 
Is This Answer Correct ?    9 Yes 9 No
Sid
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 6
(Convert.ToInt32(MyString) 
Is This Answer Correct ?    8 Yes 11 No
Sunny
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 7
int a = Convert.ToInt32("2");

int b = Int32.Parse("3");

Response.Write( a.ToString() + " " + b.ToString());
 
Is This Answer Correct ?    11 Yes 1 No
Sai Krishna
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 8
If you don't pass integer value, it gives the
exception "Input string was not in a correct format."
 
Is This Answer Correct ?    13 Yes 1 No
Sai Krishna
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 9
int.Parse parses the input (casts in a sense) to an integer
value however it will throw an exception if it cant do it if
the data provided is not numeric. you should use TryParse in
.NET 2.0 to see if it can parse it.

int a = Int.Parse("int");



Convert.ToInt32() converts the string data to a proper true
int32 value, and throws an exception if it can't convert the
value.


int a = Convert.Int32("String");
 
Is This Answer Correct ?    5 Yes 4 No
Suresh
 
  Re: How to convert a string into an Integer in ASP.net?
Answer
# 10
1))int a=int.Parse("string");
2))int a=Convert.ToInt32("string");
3))int a=(int)"string";

but the string provided should be integer
 
Is This Answer Correct ?    9 Yes 2 No
Sanjay
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
What is Boxing and Unboxing? Accenture 7
Describe the difference between inline and code behind - which is best in a loosely coupled solution Tightly coupled - INLINE   2
Which template must you provide, in order to display data in a Repeater control?   1
difference between Trace and Debug ? Patni 2
I am having four text boxes in my web application. I am setting Required Field validator to each Text box. And I am having two buttons in my application. If i clicked the first button only first two text box validation will get fire. Dont show error message for remaining two text box. If i clicked second button last two text box validation will get fired. It will not consider the first two validation controls. That is how to enable and disable the validation controls.   4
WHT IS DIFFERENCES BETWEEN HTML CONTROLS AND SERVER CONTROLS. HCL 11
What tag do you use to add a hyperlink column to the DataGrid?   1
About writting a query and SP which is better ? Satyam 5
can i use store procedure in disconnected mode? give me answer   2
When Garbage Collector will run and how its identifing whether the Object is used or Not.? Verizon 2
what exception is thrown when you do a response.redirect IBM 2
How to write test case (Unit test plan) Syntel 1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com