Is there a hard limit as to how many columns can be returned in C# SqlDataAdapter Fill?

StackOverflow https://stackoverflow.com/questions/20977818

  •  25-09-2022
  •  | 
  •  

Question

I'm currently working on a legacy project that has some SQL needs to run to get some data. They use DataTables, DataSets, etc to work with the data.

The query in question that gets executed only returns one row, however it contains well over 700 columns.

Unfortunately when the code executes to fill the data set, if the query contains over 655 columns, nothing gets returned.

Is there a way to get around this limitation so if a query returns 656+ columns data will get returned or is there some other workaround?

Thanks!

EDIT:

Chasing a red herring. The data is there, I just can't view it in the debugger as a table if there's 656+ columns in the data. The viewer can't handle more than 655.

Était-ce utile?

La solution

The data is there, I just can't view it in the debugger as a table if there's 656+ columns in the data. The viewer can't handle more than 655.

Autres conseils

Not sure if it resolve the issue but try using the overloaded Fill method

DbDataAdapter.Fill(Int32, Int32, DataTable[]).

As per MSDN document:

Adds or refreshes rows in a DataTable to match those in the data source starting at the specified record and retrieving up to the specified maximum number of records

See here for more http://msdn.microsoft.com/en-us/library/0z5wy74x%28v=vs.110%29.aspx

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top