How to get Field Name in code

John V Kane III 1 Reputation point
2021-10-14T02:39:47.383+00:00

I am trying to get the Field Name that is on the Fields tab in Dataset Properties and can't figure out how. I need to get the field name so I can compare it to a list of values. I am sure a custom function could be created, I just don't know VB.

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,799 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,569 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 40,816 Reputation points
    2021-10-14T09:05:12.023+00:00

    I am trying to get the Field Name that is on the Fields tab in Dataset Properties

    Sorry, for me it's not clear what you mean, may can you explain it more detailed, please?
    And for what/where do you need to know column names? Columns of a query are fix, so you should already know the names.


  2. Xingyu Zhao-MSFT 5,356 Reputation points
    2021-10-15T01:39:25.11+00:00

    Hi @John V Kane III ,
    A dataset usually contains many datatables. If you accepts a datatable from a dataset, you can use DataTable.TableName to get the name directly.