Reputation: 453
I have an Excel sheet that I am using to populate data in a Database. It seems as though there is only a certain number of characters that the OleDBDataReader actually reads in from a column heading before truncating the rest.
Is there a way around this?
How I am retrieving the column headings:
OleDbCommand oleDbCommand = new OleDbCommand("select * from [sheet1$]",
OleDbConnection);
OleDbDataReader reader = oleDbCommand.ExecuteReader();
DataTable dataTable = new DataTable();
dataTable.Load(reader);
foreach (DataColumn column in dataTable.Columns)
{
string columnName = column.ColumnName;
}
Expected result: Targeted programs to address the welfare needs of students. E.g breakfast clubs
Actual Result: Targeted programs to address the welfare needs of students. E.g br
I have also tried using the reader.GetName(i)
method to retrieve the information with the same result.
Upvotes: 0
Views: 4289
Reputation: 16399
64 characters is the column header limit of the Jet Engine reader.
Sorry I cannot find a better reference.
Upvotes: 1