Pass null to integer in SQL Server from ASP.NET -
datatable dt = new datatable(); dt=//calling sp return datatable dt.rows[i]["requestid"] = system.dbnull.value; // problem here
i tried
system.data.sqltypes.sqlint32.null
but without success. error:
object cannot cast dbnull other types.
please me out of this.
i implemented own simulation , have c# code calls function runs sp , returns datatable column of integers. i'm able set cell dbnull.value
without problems.
this makes me wonder if you're dealing datatable column types think are. wish reproduce experiment further. if you, next thing try using debugger @ datatable dt
, see types of columns are.
Comments
Post a Comment