error when converting from string to int

ELIRDFUL 185 Reputation points
2023-12-11T22:39:58.5633333+00:00

 

Hello everyone

 

I have the following code, but I get this error.

User's image

User's image

I count on you….

Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2023-12-12T01:07:07.97+00:00

    Hi @ELIRDFUL ,

    You can't use > directly between String and int.

    You have to convert the String into int.

    if (int.Parse(busquedaFactua.TextTotalClientes.Text) > 0 & VariablesGlobales.Aceptar == "SI")
    

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. ELIRDFUL 185 Reputation points
    2023-12-12T20:33:59.88+00:00

    Solved 100x%

     

     

     

    Thank you.....

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.