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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'Integer' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object Value) +1312273
   Jvgfoto2017.TrafikinfoTag.GridView_RowDataBound(Object sender, GridViewRowEventArgs e) +1075
   System.Web.UI.WebControls.GridView.OnRowDataBound(GridViewRowEventArgs e) +116
   System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +184
   System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3839
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +15
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +133
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +151
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   System.Web.UI.WebControls.GridView.DataBind() +10
   Jvgfoto2017.TrafikinfoTag.Uploaded(Object obj, UploadStringCompletedEventArgs Arguments) +4448
   System.Net.WebClient.OnUploadStringCompleted(UploadStringCompletedEventArgs e) +24
   System.Net.WebClient.UploadStringOperationCompleted(Object arg) +42
   System.Web.<>c__DisplayClass22_0.<Post>b__0() +20
   System.Web.Util.SynchronizationHelper.SafeWrapCallback(Action action) +92
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +102
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +64
   System.Web.Util.WithinCancellableCallbackTaskAwaiter.GetResult() +32
   System.Web.UI.<LoadRecursiveAsync>d__246.MoveNext() +396
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +102
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +64
   System.Web.Util.WithinCancellableCallbackTaskAwaiter.GetResult() +32
   System.Web.UI.<ProcessRequestMainAsync>d__523.MoveNext() +4853


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