Server Error in '/' Application.

Unable to cast object of type 'System.DBNull' to type 'System.String'.

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: Unable to cast object of type 'System.DBNull' to type 'System.String'.

Source Error:


Line 159:            ztitle_in_url = (String)zrow["title_in_url"];
Line 160:            ztitle_in_anchor = (String)zrow["title_in_anchor"];
Line 161:            zreq_title = (String)zrow["req_title"];
Line 162:            zdescr = (String)zrow["descr"];
Line 163:            zdate_open = (DateTime)zrow["date"];

Source File: d:\Applications\jobsinhand\App_code\Class_common.cs    Line: 161

Stack Trace:


[InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.]
   iv_common.class_common.get_job_link(String url_type, Int32 zsrno, String zdomain_url, String ztarget) in d:\Applications\jobsinhand\App_code\Class_common.cs:161
   list_job_one.get_job_hyperlink(Int32 zsrno) in d:\Applications\jobsinhand\list_job_one.aspx.cs:162
   ASP.list_job_one_aspx.__DataBind__control8(Object sender, EventArgs e) in d:\Applications\jobsinhand\list_job_one.aspx:129
   System.Web.UI.Control.OnDataBinding(EventArgs e) +100
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +178
   System.Web.UI.Control.DataBindChildren() +248
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +195
   System.Web.UI.Control.DataBindChildren() +248
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +195
   System.Web.UI.Control.DataBindChildren() +248
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +195
   System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +247
   System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +5190
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +97
   System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +19
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +208
   list_job_one.binddata() in d:\Applications\jobsinhand\list_job_one.aspx.cs:126
   list_job_one.Page_Load(Object sender, EventArgs e) in d:\Applications\jobsinhand\list_job_one.aspx.cs:20
   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.4654.0