Monday 29 October 2018

Too many fields defined excel import get data

///////////////
Error

too many fields defined


Case-
The internal column count that Microsoft Access uses to track the number of fields in the table has reached 255, even though you may have fewer than 255 fields in the table. This can happen because Access does not change the internal column count when you delete a field. Access also creates a new field (increasing the internal column count by 1) for every field whose properties you modify.

////////////Solution

Where////////////// A1:R51 Sheet range , selected by columns

using (OleDbDataAdapter oda = new OleDbDataAdapter("SELECT * FROM Shee$A1:R51]", excel_con))
{
  oda.Fill(dt);

 }

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...