If you have a dataview do this...
Dim x As Integer = myDataview.Table.Rows.Count
if you have a dataset then...
myDataview = myDataset.Tables(0).DefaultView
Dim x As Integer = myDataview.Table.Rows.Count
Let's say you have one datagrid that you want to display 4 columns from the 10 in the dataset, simply show the 4 that you are interested in and ignore the rest. This can be achieved at run-time as well as design-time.
I assumed you were using Server.Transfer() because I pointed this out in your other thread here ... http://www.xtremedotnettalk.com/showthread.php?s=&threadid=76875
Yes this should go outside of a sub, usaully near the top of the page
Private otherPage As SendingPage
keep in mind that SendingPage is the class name of the previous page
One way is this....
'page that contains the data (this class would be named SendingPage)
Public ReadOnly Property SomeString() As String
Get
Return SomeMemberVariable
End Get
End Property
'page that requests the data
Private otherPage As SendingPage '(the name of the previous page)
Private Sub Page_Load(....)
If Not IsPostBack Then
otherPage = CType(Context.Handler, SendingPage)
End If
'now you can use the value anywhere on this page....
dim s as string = otherPage.SomeString
End Sub
Any object can be passed using the above example.
The suggestion above would of course use code-behind, it's up to you if you want to use multiple aspx files or only one, my preference in this case would be to use a single aspx file with code-behind.