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 6618:                                <option selected disabled>Ville</option>
Line 6619:                                @foreach (DataRow dr in dt_Cities.Rows)
Line 6620:    {
Line 6621:                <option value="@((string)dr["City"])">@((string)dr["City"])</option>
Line 6622:    } 

Source File: d:\inetpub\vhosts\zesaaorg-1490.package\zesaa.org\wwwroot\option_recherche.cshtml    Line: 6620

Stack Trace:


[InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.]
   ASP._Page_option_recherche_cshtml.Execute() in d:\inetpub\vhosts\zesaaorg-1490.package\zesaa.org\wwwroot\option_recherche.cshtml:6620
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +185
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


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