Friday, March 16, 2012

News_view error

Why am I getting this error....Please help anyone

Robert

Exception Details:System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 18: Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)Line 19: Dim view As Data.DataRowView = CType(FormView1.DataItem, Data.DataRowView)Line 20: Dim o As Object = view.Item("staticURL")Line 21: If Not o Is Nothing AndAlso Not IsDBNull(o) ThenLine 22: 'We have a static URL, we need to redirect.


Source File:C:\Documents and Settings\Robert Rucker\My Documents\SwingSet Group, Inc\News_View.aspx Line:20

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] ASP.news_view_aspx.FormView1_DataBound(Object sender, EventArgs e) in C:\Documents and Settings\Robert Rucker\My Documents\SwingSet Group, Inc\News_View.aspx:20 System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e) +56 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +117 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +25 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.FormView.DataBind() +5 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.FormView.EnsureDataBound() +138 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +67 System.Web.UI.Control.EnsureChildControls() +97 System.Web.UI.Control.PreRenderRecursiveInternal() +50 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5684

FormView1.DataItem is Nothing and therefore access of the Item Property on nothing is "Object reference not set to an instance of an object"

Dim o As Object = view.Item("staticURL")


What should I do then...don't understand...should I change it?

0 comments:

Post a Comment