|
-
Feb 8th, 2010, 10:07 PM
#5
Re: reference to a non-shared member requries an object reference
 Originally Posted by taersious
@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:
Assuming the underline (and red) dsEvents is where the error is that you're telling us is a null reference exception, it's say dsEvents is null (equal to 'Nothing') when it hits that line. You should probably initialize it (dsEvents = New DataSet) at some point before using it. You might also want to fill it before using it too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|