makes-no-sense DBNull Errors

  • Thread starter Thread starter Anna Lin
  • Start date Start date
A

Anna Lin

Hi all,

I am re-posting this message with more information. We
have been getting an error (see error message) frequently
on this line.

ElseIf dsOrder.Tables("tblItem").Compute("Sum
(ItemQuantity)", "ItemQuantity > 0") > 99 Then

The ItemQuanity value can never be NULL since we use ISNULL
(ItemQuantity,0) to take away NULLs in the SQL Server
stored procedure.

What can cause this error?

Thanks, Anna
------- Error message -----

System.InvalidCastException: Operator is not valid for
type 'DBNull' and type 'Integer'. at
Microsoft.VisualBasic.CompilerServices.ObjectType.ThrowNoVa
lidOperator(Object obj1, Object obj2) at
Microsoft.VisualBasic.CompilerServices.ObjectType.ObjTst
(Object o1, Object o2, Boolean TextCompare) at
Checkout.Order_Confirm.Page_Load(Object sender, EventArgs
e) in
D:\wwwroot\SSO_dotnet\checkout\order_confirm.aspx.vb:line
173 at System.Web.UI.Control.OnLoad(EventArgs e) at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Page.ProcessRequestMain()

-------
 
do you have a situation..... where you possibably have an order.....
without any items in the database...... and your doing a join in the SP ?
 
Back
Top