I'm doing a select in an excel where I have an observation column (open text). The problem is that on some lines it truncates the contents of that column by bringing only one part.
try
{
conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%"), "Downloads") + @"\RelPosicaoGeralPendencias.xls;Extended Properties='Excel 8.0;HDR=Yes;'");
conn.Open();
cmd = new OleDbCommand("SELECT * FROM [RelPosicaoGeralPendencias$]", conn);
reader = cmd.ExecuteReader();
listaPendenciaNassau = new List<Pendencia>();
while (reader.Read())
{
if (!(reader[6] is DBNull))
{
Pendencia pendencia = new Pendencia();
pendencia.Contrato = reader[2] is DBNull ? null : reader[2].ToString().Replace("'", "").Trim();
pendencia.Tipo = reader[3] is DBNull ? null : reader[3].ToString().Trim();
pendencia.PendenciaNivel = reader[5] is DBNull ? null : reader[5].ToString().Trim();
pendencia.PendenciaId = reader[6] is DBNull ? 0 : Convert.ToInt32(reader[6]);
pendencia.PendenciaTipo = reader[8] is DBNull ? null : reader[8].ToString().Trim();
pendencia.GarantiaDescricao = reader[9] is DBNull ? null : reader[9].ToString().Trim();
pendencia.Observacao = reader[10] is DBNull ? null : reader[10].ToString().Replace("'", "").Trim();
}
}
}
Example text:
No excel:
Pending remains. The committed referrals are 2012 expired and are not in accordance with current rules so we can abide by.
COMPANY IMPORT AND EXPORT LTDA.
Signature So-and-so.
Pending: Send authorization from the majority of the share capital.
COMPANY EXPORTS AND IMPORTS LTD.
Signature: Beltran.
Pending: Send authorization of 3/4 of the share capital. COMPANY OF HORTIFRUTIGRANJEIROS LTDA
Signature: Cicrano.
Pending: Send authorization of the majority of the share capital COMPANY PRODUCTS AND DISTRIBUTION AGRICULTURAL LTD
Signature: So-and-so of Beltran.
Pending: Submit the current social contract and power of attorney granting power to provide support to third parties in isolation. Please forward the corporate documentation to the area of powers.
No c #:
Pending remains. The forwarded authorizations are 2012 expired and are not in accordance with the current rules so that we can comply. \ N \ n \ nEUROPE IMPORTACAO E EXPORTACAO LTDA. \ N \ nFullano. \ N \ nPendência: Send aut