Data conversion error

Asked

Viewed 175 times

0

I cannot open my user control form.

private void usuáriosToolStripMenuItem_Click(object sender, EventArgs e)
    {
        Usuarios USU = new Usuarios();
        sNome_usu = Status_Label_Usuario.Text;
        USU.iAcesso_Usuario = Convert.ToInt16(Status_Label_Tipo);
        USU.Show();
    }

the error is as follows :SS

  • click View Detali.... and put the most detailed error.

  • Pay attention to that line: Convert.ToInt16(Status_Label_Tipo);. What is the Status_Label_Tipo? if it is a control, like a textbox or a label, for example, the right one would be to use Status_Label_Tipo.Text. In doing so I believe you will solve

  • @Rennanhanna passes her aspx with the kind of her control Status_Label_Tipo and as you are carrying it in your code Behind, so will facilitate in answering your question.

  • Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?

1 answer

1

Might have some problems:

USU.iAcesso_Usuario = Convert.ToInt16(Status_Label_Tipo);

I put in the Github for future reference.

Maybe I should take Status_Label_Tipo.Text.

Depending on the type of USU.iAcesso_Usuario maybe the conversion needs to be changed, but you can’t tell with so little information.

I have my doubts if just putting this information is enough to show the user and be able to show the form. Again, you can’t tell with so little information.

  • A first chance Exception of type 'System.Formatexception' occurred in mscorlib.dll Additional information: The input string was not in an incorrect format.

  • this error appeared Bigown

  • Like I said, you have very little information, so it’s hard to help more than that. Maybe you shouldn’t even be doing what you’re trying to do. But you can’t know without knowing the details of the problem.

  • I have a database with 3 tables: password name and access

  • what information you need to try to help me?

Browser other questions tagged

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