0

I want to get all the table headers of my Data Class from my Data Context (named dc). enter image description here

I tried a lot of different things: enter image description here enter image description here enter image description here

And so on.

I went through a lot of different (stackoverflow) pages, but I'm stuck.

Any help is appreciated.

NetMage
  • 26,163
  • 3
  • 34
  • 55
GertDeWilde
  • 351
  • 1
  • 3
  • 18
  • Duplicate: [LINQ: Get Table Column Names](https://stackoverflow.com/questions/1803192/linq-get-table-column-names) – Gert Arnold Apr 16 '20 at 20:31
  • Like I mentioned: I tried these, and I can't get it to work, see the options that I tried above, with the error messages. – GertDeWilde Apr 17 '20 at 07:05

1 Answers1

1

Solved it by this code: So my GetType DataContext, should have been ProductionDataContext, since I renamed it to that. I was confused by the errors that VS gave, and didn't look further anymore.

Dim dc As New ProductionDataContext
Dim columnNames = dc.Mapping.MappingSource.GetModel(GetType(ProductionDataContext)).GetMetaType(GetType(tblInterventies)).DataMembers
GertDeWilde
  • 351
  • 1
  • 3
  • 18