locked
System.NullReferenceException: Object variable or With block variable not set. RRS feed

  • Question

  • User628908224 posted
    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 variable or With block variable not set. Source Error: Line 73: Dim yStr As String : yStr = Session("id") Line 74: Dim BookDataTableView As New DataView() Line 75: BookDataTableView.Table = Cache("CachedBooks").Tables("Books") Line 76: BookDataTableView.Sort = "MemberID ='" + Session("id") + "'" Line 77: -------------------- My error is on line 75 Here is my code... Dim yStr As String : yStr = Session("id") Dim BookDataTableView As New DataView() BookDataTableView.Table = Cache("CachedBooks").Tables("Books") BookDataTableView.Sort = "MemberID ='" + Session("id") + "'" gridofbooks.DataSource = BookDataTableView gridofbooks.DataBind() Can someone tell me why I might be getting this error. Cache("CachedBooks").Tables("Books") is a cached Dataset and im assigning the dataset table to the dataview.
    Thursday, November 6, 2003 6:43 AM

All replies