You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MCVE
Replace printUser function from the Sample with one below:
letprintUser(dr:IDataRecord)=letid=(dr?id).Value
letname=(dr?name).Value
letaddress=letai= dr.GetOrdinal("address")if dr.IsDBNull ai then None
else dr.GetString(ai)|> Some
|>function| None ->"No registered address"| Some x -> x
printfn "Id: %d; Name: %s; Address: %s" id name address
Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.DBNull'.
at Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.UnboxGeneric[T](Object source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\prim-types.fs:line 598
at FsSqlImpl.DictDataRecord.System-Data-IDataRecord-IsDBNull(Int32 i)
The text was updated successfully, but these errors were encountered:
Call of
dr.IsDBNull
throws InvalidCastException.MCVE
Replace
printUser
function from the Sample with one below:The text was updated successfully, but these errors were encountered: