Server Error in '/' Application.

Conversion from type 'DBNull' to type 'Integer' is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Integer' is not valid.

Source Error:


Line 1039: For i As Integer = 0 To countrow Line 1040: strCTree = "" Line 1041: str_item_name += " <p><a href=""Place_Details.aspx?ID=" & dt.Rows(i)("CountriesID") & """>" & (Me.GetContryTree(dt.Rows(i)("CountriesID"))) & "</a> </p>" Line 1042: Next Line 1043: Return str_item_name

Source File: C:\Inetpub\vhosts\nfa-eg.org\httpdocs\App_Code\BLL.vb    Line: 1041

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'Integer' is not valid.] Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object Value) +953 BLL.place_by_item(String item_id, Boolean more) in C:\Inetpub\vhosts\nfa-eg.org\httpdocs\App_Code\BLL.vb:1041 Search_Items_Details.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\nfa-eg.org\httpdocs\Search\Items_Details.aspx.vb:17 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8813; ASP.NET Version:2.0.50727.8813