Error of Input Characters

Asked

Viewed 17 times

0

Good Night I’m making a registration system with mysql database, but I’m going through difficulties, I’m mounting the crud of displaying data is working perfectly but the insert I’m having trouble

public class Products { public Products Obj = new Products(); //Pull Class Reader to Class Display

    public DataTable MostrarPodutos()
    {
        DataTable tabela = new DataTable(); //Criando uma tabela nova 
        tabela = Obj.Mostrar(); //O mostrar esta na classe leitora (Segundo passo)
        return tabela;


    }

    public void Iserirdados(String Nome, string Idade, String Endereco, string Tel, string Cel)
    {

        Obj.Insertar(Nome,Convert.ToInt32 (Idade), Endereco,Convert.ToInt32(Tel),Convert.ToInt32(Cel)); //Passa os dados por aqui  //obj.colocar setado na classe Produto

    }
}

}

I have a problem in (Obj.Insertar(Name,Convert.Toint32(Age), Address,Convert.Toint32(Tel),Convert.Toint32(Cel));) it says that the input string was not in a correct format, someone can help me

  • If the data can come wrong you can not convert, have to try to make a parse and only accept the value if it has been converted correctly, has information in the questions linked.

  • I didn’t get it right, if the parse you refer to conversion from int to string, already tried it from error, you could give me an example of what to do ?

  • Just search the site, there must be dozens of questions showing.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.