.. "" to type 'integer' is not valid,'

P

Portroe

on running debug I get the following error,

' cast from string "" to type 'integer' is not valid,'

I am experimenting with file writing and reading,

what sort of error am I looking for in my code here?

the first time I ran the code it worked,

baffled,

Portroe
 
A

Armin Zingler

Portroe said:
on running debug I get the following error,

' cast from string "" to type 'integer' is not valid,'

I am experimenting with file writing and reading,

what sort of error am I looking for in my code here?

the first time I ran the code it worked,

Right, "" can not be converted to integer. Do you try to convert it? If yes,
that's the reason for the problem. If no, show us the line throwing this
exception and the values of the used variables.
 
P

Portroe

okay, I have being using txtage.Text = "" to clear the textbox on
submit,

how can I work around this?

thanks
 
A

Armin Zingler

Portroe said:
okay, I have being using txtage.Text = "" to clear the textbox on
submit,

I can not imagine that the line above throws the invalid cast exception.
 
H

Herfried K. Wagner [MVP]

* Portroe said:
okay, I have being using txtage.Text = "" to clear the textbox on
submit,

Post the piece of code how you convert/try to convert the string
to an integer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top