I am trying to copy a large Excel spreadsheet into the SQL Server database. I am opening an OldDbConnection to the Excel spreadsheet and reading everything from the [Sheet1$]. Then, I am using the OleDbCommand to get a IDataReader with the spreadsheet data.
There are several cells in the Excel sheet with text contents of more than 256 characters. But, once this gets uploaded to the database table using SqlBulkCopy, I only see first 255 characters from these excel cells in the database. The database table fields are 5000 characters long.
Does SqlBulkCopy limit the field size? Thanks!
I am not aware of SqlBulkCopy and OldDbConnection.
however Excel might be giving out first 255 chars.
In Excel if you access a cells value with .value property you get first 255 chars, and if you acccess it with .text property you get full text. Hope this will give you some idea.