-1

I am trying to use the solution given here ->

C# ADO.NET: nulls and DbNull -- is there more efficient syntax?

But I am working with an int.

Thanks

Community
  • 1
  • 1
Copeleto
  • 309
  • 6
  • 12

2 Answers2

0

Substitute int? for DateTime? then...

David M
  • 71,481
  • 13
  • 158
  • 186
0
int? myNullableInt = null;
myIntParameter.Value = myNullableInt ?? (object)DBNull.Value;
D'Arcy Rittich
  • 167,292
  • 40
  • 290
  • 283