Server Error in '/' Application.

Object reference not set to an instance of an object.

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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 171:                    produtos.Append("order by cg.descricao asc; ");
Line 172:
Line 173:                    DataTable dtProdutos = DBCommon.Retorna(produtos.ToString()).ToTable();
Line 174: 
Line 175:                    for (int i = 0; i < dtProdutos.Rows.Count; i++)

Source File: c:\web\allwam.com.br\httpdocs\Views\Shared\Site.Master    Line: 173

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   TRV.Data.DBCommon.Retorna(String ClausulaSQL) +52
   ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\web\allwam.com.br\httpdocs\Views\Shared\Site.Master:173
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13
   System.Web.UI.Control.Render(HtmlTextWriter writer) +12
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1303


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