Is this code correct for a Dataview
Hello all,
I am trying to get the hang of making Dataviews. But it is not working for me. Could you tell me if the code below has something wrong with it and what it is. I want to make 2 dataviews based on the same Table from my database.
Dim ds as new Dataset()
Dim dTable as New DataTable()
Dim DataView1 as New Dataview(dTable)
Dataview1.Sort ="JokeID DESC"
Dataview1.Rowfilter="Category = Animals TOP 5"
DataGrid1.DataSource= ds.Tables("dTable").dataview1
DataGrid1.Datbind()
Dim DataView2 as New Dataview(dTable)
Dataview2.Sort ="JokeID DESC"
Dataview2.Rowfilter="Category = Office TOP 5"
DataGrid2.DataSource= ds.Tables("dTable").dataview2
DataGrid2.Datbind()
Thanks for your help. I appreciate it a lot.
Ray
|