문제

I have a data grid view in which i have column of number of citations. i am trying this code to retrieve data from column but its throwing an format exception exception,please help here is my code:

    int GSCitations = int.Parse(Convert.ToString(row.Cells[2].Value));
도움이 되었습니까?

해결책

This can only mean, that the content of row.Cells[2] is not a valid integer and can't be converted to int.

Use Int32.TryParse instead

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top