Results 1 to 6 of 6

Thread: reference to a non-shared member requries an object reference

Threaded View

  1. #4

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    2

    Re: reference to a non-shared member requries an object reference

    @minitech
    Yes, when I changed Table.rows to dt.rows and Table.columns to dt.columns, the problem went away.

    But a new problem shows up now.
    Code:
        Public Sub showdataset()
            For Each dt As DataTable In dsEvents.Tables
                Response.Write("<table border='1'>" & vbCrLf)
                For Each row As DataRow In dt.Rows
                    Response.Write("<tr>" & vbCrLf)
                    For Each dc As DataColumn In dt.Columns
                        Response.Write("<td>" & row(dc).ToString & "</td>" & vbCrLf)
                    Next
                    Response.Write("</tr>" & vbCrLf)
                Next
                Response.Write("</table>" & vbCrLf)
            Next
        End Sub
    I've tried passing the Dataset as a referenced argument to this Sub, but that was no help.
    To be more specific, the exact error is:
    System.NullReferenceException: Object reference not set to an instance of an object.
    Last edited by taersious; Feb 8th, 2010 at 07:54 PM. Reason: Problem not solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width