Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a data on my web I want to run the RSS FEED the subject above is the Compiler Error Message CS0030 Cannot convert type string to int Kindly help
Posted
Comments
Hiren solanki 20-Jan-11 3:48am    
are you sure your string is equivalent to int ? I mean if you are converting 'A12' to int then it might throw error. otherwise follow answer by JF2015.

Hi,

you need to implicitly convert an string to an int as here:
C#
string strNumber = "123";
int nTest = 0;
Int32.TryParse(strNumber, out nTest);
 
Share this answer
 
v2
Comments
Davids Sukamanga 20-Jan-11 3:53am    
Still could not work kindly give me, Iam working a web page using ASP.NET
JF2015 20-Jan-11 3:57am    
Can you show us the code that is causing the compiler issue? Otherwise we can only guess what's wrong.
Davids Sukamanga 20-Jan-11 4:49am    
Thanks
int intA=Convert.ToInt32("string");


Use this code this will be very simple to convert a string into an Integer.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900