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
 
Is it possible to prevent a browser from caching an ASPX page?   2
why many web.config files are used in are project   2
how can i call output parameters from ado.net TCS 3
Difference Between GridView And DataList   2
What are the differences between Trace and Debug? Accenture 2
33) You create English, French, and German versions of your ASP.NET application. You have separate resource files for each language version. You need to deploy the appropriate resource file based on the language settings of the server. What should you do? A . Create an installer and set the Installer.Context property for each version of your application. B . Create an installer that has a launch condition to verify the locale settings. C . Create an installer that has a custom action to install only location-specific files. D . Create an installer that has an MsiConfigureProduct function to install the appropriate version. Syntax-Softtech 2
How do you manage session in ASP and ASP.NET ? Microsoft 2
can i call the java script to code behind file?if yes how? Wipro 4
Which template must you provide, in order to display data in a Repeater control?   1
How many classes can a single .NET DLL contain?   13
Which control would you use if you needed to make sure the values in two different controls matched?   1
How we generate the BARCODE in ASP.Net using c# ! in library management systen for books .   2
 
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