Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Depth probably shouldn't be misused to return the current row index #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
appel1 opened this issue Nov 15, 2019 · 3 comments
Open

Depth probably shouldn't be misused to return the current row index #443

appel1 opened this issue Nov 15, 2019 · 3 comments
Labels
Milestone

Comments

@appel1
Copy link
Collaborator

appel1 commented Nov 15, 2019

public int Depth { get; private set; }

The IDataReader.Depth property should return the depth of nesting for the current row which, I think, is not the same as row index.

https://docs.microsoft.com/en-us/dotnet/api/system.data.idatareader.depth?view=netframework-4.8

Would be a breaking change though.

@Seabizkit
Copy link

Could a better explanation with an example be added. plz

Its not stopping me from doing anything, just for my own understanding.

I understood, Depth in regards to (rowReader.Depth) to be how deep it is in the Read()....
So if its 0 based;

Read() Read() Read()

would be Depth: 2

Its basically is the row index, which is how it work now... from what i understand.

What im trying to understand, is an example of what the proper implementation would be:

depth of nesting for the current row

Thinking about it, does this become applicable when the sheet has some sort of complexity?
beyond the norm, Like cells are merged or something?

what would the sheet need for the "Depth" if implemented "correctly" to be something other than the index.

Thanks

@appel1
Copy link
Collaborator Author

appel1 commented Jan 7, 2020

Depth is for readers that support nested results. I'm not aware of any implementation that support this. SQL Server and MySQL doesn't and their IDataReader.Depth implementations always return 0.

@andersnm
Copy link
Collaborator

andersnm commented Jan 7, 2020

Wonder if its for something like subdatasheets in f.ex Access:

Seems the best fit per the the documentation remarks "The outermost table has a depth of zero."

@appel1 appel1 added the breaking label Dec 1, 2022
@appel1 appel1 added this to the 4.0 milestone Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants