Server Error in '/' Application.

Conversion from type 'DBNull' to type 'String' 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 'String' is not valid.

Source Error:


Line 141:		if sql_data.Rows.Count>0 then 		
Line 142:			For Each row As System.Data.DataRow In sql_data.Rows
Line 143:				tmp = row("poster")	
Line 144:			next
Line 145:		end if

Source File: D:\website\ghadirinews\App_Code\ghFunctions_v2.vb    Line: 143

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +1113
   ghFunctions_v2.ID2Poster(String nCode) in D:\website\ghadirinews\App_Code\ghFunctions_v2.vb:143
   _Default._Default_Load(Object sender, EventArgs e) in D:\website\ghadirinews\news\paper\page\Default.aspx.vb:25
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4380.0