Closed GoogleCodeExporter closed 9 years ago
Original comment by shannon....@gmail.com
on 18 Sep 2009 at 4:42
Original comment by shannon....@gmail.com
on 6 Oct 2009 at 3:36
[deleted comment]
Original comment by shannon....@gmail.com
on 7 Oct 2009 at 4:12
Original comment by bniemyjski
on 8 Oct 2009 at 7:20
Hello,
You need to add in a null check. If you call the Empty constructor of
SqlInt32() it
will pass in null.
int? nullInt = null;
var updatenullableIntTable = new InsertUpdatenullableIntTable("Data
Source=.;Initial
Catalog=wrappers;Integrated Security=True");
updatenullableIntTable.id = "test";
updatenullableIntTable.nullableIntColumn = nullInt.HasValue ? new
SqlInt32(nullInt.Value) : new SqlInt32();
updatenullableIntTable.Execute();
By taking a look at SQL Profiler we can see this is the expected result:
exec [dbo].[usp_InsertUpdatenullableIntTable]
@nullableIntColumn=NULL,@id=N'test '
go
Thanks
-Blake Niemyjski
Original comment by bniemyjski
on 12 Oct 2009 at 12:01
Original issue reported on code.google.com by
blak...@gmail.com
on 15 Sep 2009 at 8:10