Data conversion error

0

I can not 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:

    
asked by anonymous 07.11.2015 / 12:30

1 answer

1

You may have some problems:

USU.iAcesso_Usuario = Convert.ToInt16(Status_Label_Tipo);

Maybe you should get Status_Label_Tipo.Text .

Depending on the type of USU.iAcesso_Usuario perhaps the conversion needs to be changed, but you can not say 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 not tell with so little information.

    
07.11.2015 / 12:35