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.  Depth 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 a value that indicates the depth of nesting for the current row.

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

####  Property Value

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

The depth of nesting for the current row.

####  Implements

[ Depth ](system.data.idatareader.depth?view=dotnet-plat-ext-8.0#system-data-
idatareader-depth)

##  Remarks

The outermost table has a depth of zero. The .NET Framework Data Provider for
SQL Server does not support nesting and always returns zero.

##  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/intellectualproperty/Trademarks/)
  * ©