diff options
author | Jonathan Braswell <jbraswell@localhost.localdomain> | 2015-03-27 06:43:12 +0300 |
---|---|---|
committer | Jonathan Braswell <jbraswell@localhost.localdomain> | 2015-03-27 06:43:12 +0300 |
commit | 7ed9d55b181b0199483734102dc203a1e629e46b (patch) | |
tree | 7736e7991bfe03f06df106855d261e0bdb5da526 /mcs/class/Mono.Data.Tds | |
parent | 059538c11a961b0a08d834d09d1e46cc427ebd4c (diff) |
Fix issue with inserting null values into integer and datetime columns in Sql Server.
This resolves https://bugzilla.xamarin.com/show_bug.cgi?id=26546.
Diffstat (limited to 'mcs/class/Mono.Data.Tds')
-rw-r--r-- | mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs index f484b727fb5..54210049067 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs @@ -559,8 +559,10 @@ namespace Mono.Data.Tds.Protocol * If the value is null, not setting the size to 0 will cause varchar * fields to get inserted as an empty string rather than an null. */ - if (param.Value == null || param.Value == DBNull.Value) - size = 0; + if (colType != TdsColumnType.IntN && colType != TdsColumnType.DateTimeN) { + if (param.Value == null || param.Value == DBNull.Value) + size = 0; + } // Change colType according to the following table /* |