-
Notifications
You must be signed in to change notification settings - Fork 454
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
SQL Server Compact 4.0 ntext field with null value throws an exception in BulkCopy (single Insert is working correctly) #4436
Comments
Looks like another case where database fails to type Generated SQL: INSERT INTO [Users]
(
[Name],
[LongString]
)
SELECT 'Test',NULL |
Could you please elaborate about column description: do I need both DataType and DbType attribute? It's not clear for me when only DbType is insufficient and I should use both. Thank you. |
In most cases you don't need any of those as we can infer required information about type from C# type (except length, precision, scale parameters). In cases when non-default mapping between C# and database types used, you need to specify DataType. E.g. C# Cases when |
Thank you. As I can see here when |
Nope. https://github.com/linq2db/linq2db/blob/master/Source/LinqToDB/Mapping/MappingSchema.cs#L1376 |
Describe your issue
I have a User entity with two string fields - Name has default mapping (nvarchar(4000)), LongString is mapped to ntext.
If I insert single user (with LongString = null) it is working without any problem.
If I insert same user with BulkCopy - System.Data.SqlServerCe.SqlCeException is thrown.
Steps to reproduce
Environment details
Linq To DB
version: 5.4.0Database (with version): SQL Server Compact 4.0
ADO.NET Provider (with version): linq2db.SqlCe 5.4.0
Operating system: Windows 10 22H2
.NET Version: .Net Framework 4.7.2
The text was updated successfully, but these errors were encountered: