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

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...