-
Notifications
You must be signed in to change notification settings - Fork 12
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
Doesn't help for SqlDataAdapter.Fill #28
Comments
Given there is little to no documentation on this I've tried my best to get this to work, but take a look at the following:
So, yeah this works if you want to blindly get a geometry column that you already know is there and you don't want to use a DataAdapter to put it into a DataTable. In that case you are fine. |
Correct. This library was created as a workaround to dotnet/SqlClient#30. It bypasses the expected SqlGeography and SqlGeometry types and reads and writes the underlying bytes directly using NetTopologySuite types instead. Any code other than the examples provided in the README will still try to go through the (non-existent) SqlGeography and SqlGeometry types and throw. Please upvote dotnet/SqlClient#30 so the SqlClient team at Microsoft can prioritize full spatial support in modern .NET. |
Another workaround available is the dotmorten.Microsoft.SqlServer.Types NuGet package. I believe it should be able to work with SqlDataAdapter. |
And finally, you might even be able to just install the official .NET Framework NuGet package into a .NET project. I expect it'll work just fine on Windows. |
The dotmorten package throws exceptions and has some strange behavior, rather than go down that route I've just built the DataTable using a DataReader and this library. It's a decent stop gap but yeah ideally Microsoft would provide actual support. Thanks for the responses. |
This library works for a narrow case where you don't need to use GetFieldType of the DataReader or if you don't need to Fill a DataTable from an adapter. In this case you get null references and failures.
The text was updated successfully, but these errors were encountered: