Skip to content
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 work for SqlBulkCopy #29

Open
mxcolin opened this issue Sep 26, 2022 · 2 comments
Open

Doesn't work for SqlBulkCopy #29

mxcolin opened this issue Sep 26, 2022 · 2 comments

Comments

@mxcolin
Copy link

mxcolin commented Sep 26, 2022

I've tried using this with SqlBulkCopy but I get the following:

System.InvalidOperationException: The given value 'System.Data.SqlTypes.SqlBytes' of type SqlBytes from the data source cannot be converted to type udt for Column 1 [GeoData] Row 1. ---> System.ArgumentException: Specified type is not registered on the target server. System.Data.SqlTypes.SqlBytes, System.Data.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

I've tried creating the DataColumn as

DataColumn newGeometryColumn = new DataColumn("geo_column", typeof(SqlBytes));

But not sure if that's the right way to achieve this.

@bricelam
Copy link
Collaborator

Hmm, I'm not sure this is supported by dotnet/SqlClient. Can you file an issue there and see if they know of a way to do it?

@mxcolin
Copy link
Author

mxcolin commented Oct 4, 2022

You can do SqlBulkCopy in SqlClient but then you have to reference System.Data.SqlTypes which means it won't work on .Net Core which is why I'm using this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants