0

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.

1 Answer 1

1

64 characters is the column header limit of the Jet Engine reader.

http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/2fb51d81-3d64-445f-806a-519861b561ba/

Sorry I cannot find a better reference.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for that. I had a feeling it was something like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.