Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security
updates, and technical support.

[ Download Microsoft Edge ](https://go.microsoft.com/fwlink/p/?LinkID=2092881
) [ More info about Internet Explorer and Microsoft Edge
](https://learn.microsoft.com/en-us/lifecycle/faq/internet-explorer-microsoft-
edge)

Table of contents  Exit focus mode

Language

  *   *   *   * 

Read in English  Save  [ ](https://github.com/dotnet/dotnet-api-
docs/blob/main/xml/System.Data.SqlClient/SqlDataReader.xml "Edit This
Document")

Table of contents  Read in English  Save  [ Edit
](https://github.com/dotnet/dotnet-api-
docs/blob/main/xml/System.Data.SqlClient/SqlDataReader.xml "Edit This
Document") Print

Twitter  LinkedIn  Facebook  Email

Table of contents

#  Sql  Data  Reader.  Visible  Field  Count Property

  * Reference 

Feedback

##

##  Definition

Namespace:

     [ System.Data.SqlClient ](system.data.sqlclient?view=dotnet-plat-ext-8.0)

Assembly:

     System.Data.SqlClient.dll 

Assembly:

     System.Data.dll 

Package:

     System.Data.SqlClient v4.8.6 

Important

Some information relates to prerelease product that may be substantially
modified before itâs released. Microsoft makes no warranties, express or
implied, with respect to the information provided here.

Gets the number of fields in the [ SqlDataReader
](system.data.sqlclient.sqldatareader?view=dotnet-plat-ext-8.0) that are not
hidden.

    
    
    public:
     virtual property int VisibleFieldCount { int get(); };
    
    
    public override int VisibleFieldCount { get; }
    
    
    member this.VisibleFieldCount : int
    
    
    Public Overrides ReadOnly Property VisibleFieldCount As Integer

####  Property Value

[ Int32 ](system.int32?view=dotnet-plat-ext-8.0)

The number of fields that are not hidden.

##  Remarks

This value is used to determine how many fields in the [ SqlDataReader
](system.data.sqlclient.sqldatareader?view=dotnet-plat-ext-8.0) are visible.
For example, a SELECT on a partial primary key returns the remaining parts of
the key as hidden fields. The hidden fields are always appended behind the
visible fields.

##  Applies to

##  See also

  * [ DataAdapters and DataReaders (ADO.NET) ](/en-us/dotnet/framework/data/adonet/dataadapters-and-datareaders)
  * [ SQL Server and ADO.NET ](/en-us/dotnet/framework/data/adonet/sql/)
  * [ ADO.NET Overview ](/en-us/dotnet/framework/data/adonet/ado-net-overview)

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create
and review issues and pull requests. For more information, see [ our
contributor guide ](https://learn.microsoft.com/contribute/content/dotnet/api-
documentation) .

![](https://learn.microsoft.com/media/logos/logo_net.svg)
![](https://learn.microsoft.com/media/logos/logo_net.svg)

.NET

[ Open a documentation issue  ]() [ Provide product feedback
](https://aka.ms/feedback/report?space=61)

##  Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the
feedback mechanism for content and replacing it with a new feedback system.
For more information see: [ https://aka.ms/ContentUserFeedback
](https://aka.ms/ContentUserFeedback) .

Submit and view feedback for

[ This product  ](https://aka.ms/feedback/report?space=61) This page

[ View all page feedback  ](https://github.com/dotnet/dotnet-api-docs/issues)

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellec