MicrosoftDocs / feedback

📢 docs.microsoft.com site feedback
https://learn.microsoft.com
Creative Commons Attribution 4.0 International
239 stars 160 forks source link

DataView.RowFilter doc needs improvement #1204

Open mdell-seradex opened 5 years ago

mdell-seradex commented 5 years ago

The documentation page referenced below states that "To return only those columns with null values, use the following expression: "Isnull(Col1,'Null Column') = 'Null Column'" " In my experience "Col1 IS NULL" now works correctly, and using the suggested pattern is problematic at best as it assumes that there is no row where Col1 has the value 'Null Column'. Granted it is a low likelihood, but it is not impossible. It could be a table that documents data for another database.

In addition, it states nothing about handling injection issues when filtering on String values. For instance if a non-wildcard type match (=, <>, etc.), a filter such as this will throw an error "Col1 = 'O'Brien'". If using a wildcard type match (LIKE), what is needed to ensure that real data is not confused for wildcards (e.g. "Col1 LIKE '%25%'" where the attempt is to find all rows that end in "25%")?

The article does state to "See the Expression property of the DataColumn class for more information", but these two topics are buried within that page and difficult for many to find. This page on the RowFilter should at least briefly mention these two issues and that it is mentioned how to address them there if not explicitly addressed in this page.

https://docs.microsoft.com/en-us/dotnet/api/system.data.dataview.rowfilter?view=netframework-4.7.2

I look forward to hearing your feedback on this. Thank you.

rootsmusic commented 2 years ago

@mdell-seradex Please move this issue to https://github.com/dotnet/dotnet-api-docs/issues

mdell-seradex commented 1 year ago

@rootsmusic How do I move the issue? I see back in 2018 Github had a way to transfer an issue to another repro by using "Transfer this issue" in the right sidebar, but I do not see that.

rootsmusic commented 1 year ago

@mdell-seradex You can just open a new issue in that repo and close this one.