When compiling my web application, it returns me the following message log:
The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.
The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.
The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.
The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.
However, it is not loading the message sequentially, the correct one was to show the following message:
The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.
The CPF / CNPJ reported in cell H referring to row 2 is in an incorrect format. Please correct the spreadsheet.
The CPF / CNPJ reported in cell H referring to row 3 is in an incorrect format. Please correct the spreadsheet.
How can I remedy this situation?
Here's my code:
- private Interested setInterested o(DataRow line)
- {
- if (!line.ItemArray[12].ToString().Equals(""))
- interested .Cep = line.ItemArray[12].ToString();
- if (!line.ItemArray[7].ToString().Equals(""))
- if (line.ItemArray[7].ToString().Length == 14)
- {
- interested .CPF_CNPJ = HelpCPF_CNPJ.DeformationCPF(line.ItemArray[7].ToString());
- interested.Tipo = 1;
- }
- else if (line.ItemArray[7].ToString().Length == 18)
- {
- interested.CPF_CNPJ = HelpCPF_CNPJ.DeformationCNPJ(line.ItemArray[7].ToString());
- interested.Tipo = 2;
- }
- else
- {
- int i = 0;
- i = i + 1;
- log.Append("The CPF / CNPJ informed in cell H referring to the line " + (i) + "is in an incorrect format. Please correct the spreadsheet. <br>");
- fileInvalidated = true;
- }
-
- return interested;
- }
- }