J
James T.
Hello!
Is it possible to fill a DataSet only once without need to fill it again
every time in custom methods?
Dim myDS As DataSet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Dim Products As ProductsData
myDS = Products.GetAll()
DataGrid1.DataSource = myDS
DataGrid1.DataBind()
End If
End Sub
Following code generates an error: "Object reference not set to an instance
of an object."
Private Sub ShowDataGrid2()
DataGrid2.DataSource = myDS
DataGrid2.DataBind()
End Sub
Thanks!
Is it possible to fill a DataSet only once without need to fill it again
every time in custom methods?
Dim myDS As DataSet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Dim Products As ProductsData
myDS = Products.GetAll()
DataGrid1.DataSource = myDS
DataGrid1.DataBind()
End If
End Sub
Following code generates an error: "Object reference not set to an instance
of an object."
Private Sub ShowDataGrid2()
DataGrid2.DataSource = myDS
DataGrid2.DataBind()
End Sub
Thanks!