google-code-export / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
Other
0 stars 0 forks source link

BulkInsert SqlServer fails for nullable (2) #309

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue #124 gives a solution for nullable types for BulkInsert for SQL Server.

The patch is not correct. Please change in SQLVender.cs the following:

Old:
dc.DataType = column.Member.GetMemberType();
                if (dc.DataType.IsNullable())
                {
                    dc.AllowDBNull  = true;
                    dc.DataType     = dc.DataType.GetNullableType();
                }

New:
if (column.Member.GetMemberType().IsNullable())
                {
                    dc.AllowDBNull  = true;
                    dc.DataType     = column.Member.GetMemberType().GetNullableType();
                }
                else dc.DataType = column.Member.GetMemberType();

Original issue reported on code.google.com by sportfr...@gmail.com on 17 Mar 2011 at 1:59