A
Anandvj
Hello
Here is my requirement
Dim oCategories as Dataset
Dim ds as Dataset
Private Sub Page_Load(...)
If Not Page.IsPostBack Then
oCategories = new Dataset
ds = new dataset
Dim busObj as XXX
' Get values as dataset from business object
oCategories = busObj.GetCategories()
' Assign it to another Dataset
ds = oCategories
BindData()
End If
End Sub
Private Sub BindData()
If ds.Tables(0).Rows.Count() > 0 Then
DataGrid1.DataSource = ds
DataGrid1.DataBind()
Else
'Handle Error
End If
End Sub
Paging is enabled in the datagrid. So...
Sub NewPage(...)
DataGrid1.CurrentPageIndex = e.NewPageIndex
Call Binddata()
End Sub
When i try to call the Subroutine BindData(), it gives error "Object
reference not set to an instance of an object" which is because "ds"
is out of scope.
Can Dataset work in disconnected? Is there a way to store the dataset
so that i don't have to access the business object every time i
navigate across pages.
Thanks
Anand
Here is my requirement
Dim oCategories as Dataset
Dim ds as Dataset
Private Sub Page_Load(...)
If Not Page.IsPostBack Then
oCategories = new Dataset
ds = new dataset
Dim busObj as XXX
' Get values as dataset from business object
oCategories = busObj.GetCategories()
' Assign it to another Dataset
ds = oCategories
BindData()
End If
End Sub
Private Sub BindData()
If ds.Tables(0).Rows.Count() > 0 Then
DataGrid1.DataSource = ds
DataGrid1.DataBind()
Else
'Handle Error
End If
End Sub
Paging is enabled in the datagrid. So...
Sub NewPage(...)
DataGrid1.CurrentPageIndex = e.NewPageIndex
Call Binddata()
End Sub
When i try to call the Subroutine BindData(), it gives error "Object
reference not set to an instance of an object" which is because "ds"
is out of scope.
Can Dataset work in disconnected? Is there a way to store the dataset
so that i don't have to access the business object every time i
navigate across pages.
Thanks
Anand