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 271:            imgTarget.Src = (string)dt.Rows[0]["FullImg"];
Line 272:            imagePopup.HRef = (string)dt.Rows[0]["PopupImg"];
Line 273:            imagePopup.Title = (string)dt.Rows[0]["Header"];
Line 274:        }
Line 275:    }

Source File: d:\Inetpub\test_photonics_ru\Moduls\Gallery\client.ascx.cs    Line: 273

Stack Trace:


[InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.]
   Moduls_News_client.BindData() in d:\Inetpub\test_photonics_ru\Moduls\Gallery\client.ascx.cs:273
   Moduls_News_client.ShowList() in d:\Inetpub\test_photonics_ru\Moduls\Gallery\client.ascx.cs:118
   Moduls_News_client.LoadData() in d:\Inetpub\test_photonics_ru\Moduls\Gallery\client.ascx.cs:89
   Moduls_News_client.Page_Load(Object sender, EventArgs e) in d:\Inetpub\test_photonics_ru\Moduls\Gallery\client.ascx.cs:46
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.3662; ASP.NET Version:2.0.50727.3668