N
.Net Sports
I'm trying to match fields from XML feed to a datarow, but I get a
"System.InvalidCastException: Object cannot be cast from DBNull to
other types" error at the PkgAmount line. This code was converted from
original C# code, so I'm wondering if it has something to do with C#'s
strict datatype criteria (even tho this is in vb.net), or I need to do
something extra around the
FormatAmount(Convert.ToSingle(drwData("PkgAmount"))) ...
'''''''''''''''''
Dim drwData As DataRow
For Each drwData In dtaData.Rows
Dim SID As String = "SID=" & Convert.ToString(drwData("ID")) & "&"
Dim PurchaseTypeID As String = Convert.ToString(drwData("PurchaseID"))
Dim PkgAmount As String =
FormatAmount(Convert.ToSingle(drwData("PkgAmount")))
'''''''''''''''''''''
TIA
netsports
"System.InvalidCastException: Object cannot be cast from DBNull to
other types" error at the PkgAmount line. This code was converted from
original C# code, so I'm wondering if it has something to do with C#'s
strict datatype criteria (even tho this is in vb.net), or I need to do
something extra around the
FormatAmount(Convert.ToSingle(drwData("PkgAmount"))) ...
'''''''''''''''''
Dim drwData As DataRow
For Each drwData In dtaData.Rows
Dim SID As String = "SID=" & Convert.ToString(drwData("ID")) & "&"
Dim PurchaseTypeID As String = Convert.ToString(drwData("PurchaseID"))
Dim PkgAmount As String =
FormatAmount(Convert.ToSingle(drwData("PkgAmount")))
'''''''''''''''''''''
TIA
netsports