“Input string was not in a correct format.”

后端 未结 5 1971

I am working on a project in which I have a form through which I can edit a question available in a list view. Whenever I select a row from the list view and click on the \'

5条回答
  •  爱一瞬间的悲伤
    2020-12-11 03:02

    Please change your code like below.

      int QuestionID;
    
      bool IsIntValue = Int32.TryParse("YOUR-VARIABLE", out QuestionID);
    
      if (IsIntValue)
      {
          // YOUR CODE HERE  
      }
    

    Hope i will be help.

提交回复
热议问题