Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
What is wrong here in the code

VB
 Dim sReaderList As String
sReaderList = New System.String(vbNullChar, 2048)
      

       Dim x As Integer = Convert.ToInt32(sReaderList)



When debug it produce "Format Exception was Unhandeled"
and Input string was not in a correct format in vb.net
Posted
Updated 9-Nov-11 23:57pm
v2

1 solution

You are trying to convert a string of 2048 NULL characters to integer value. Of course it would give an exception. What are you trying to achieve?
 
Share this answer
 
Comments
vikky08 10-Nov-11 6:07am    
Its comment or answer?
Timberbird 10-Nov-11 6:14am    
It contains an answer (you asked what's wrong with your code? it tries to convert obviously incorrect data, nothing more) and a question: what should your code actually do? You have an answer for the question now, and if you bother to explain what do you actually try to achieve, you could also get some help

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