J
Jeff
....still new to vb.net and vs 2005 web applications.
I remain confused about the "shared" variable/table designation and the
difference between "public" etc. I wish to place an entire table from a DB
into a datatable and then use it in a variety of different subs not unlike
the code below. I'm not positive, but it seems that "shared" might also
share the table across users, and this is not what I want. I only wish to be
able to access the table from multiple subs without running code to read it
from the DB in each sub. (but it will be a different table for each user).
Perhaps I need "public" or similar instead?
What should I be doing here for my purpose?
Thanks
Jeff
Shared MyTable As New DataTable
Protected Sub Page_Load ...
If Not Page.IsPostBack Then
MyTable = g.GetTable()
end if
Sub whatever()
MyTable.Rows(Session("Var1"))(Session("Var2"))
End sub
Sub whatever2()
MyTable.Rows(Session("Var3"))(Session("Var4"))
End sub
I remain confused about the "shared" variable/table designation and the
difference between "public" etc. I wish to place an entire table from a DB
into a datatable and then use it in a variety of different subs not unlike
the code below. I'm not positive, but it seems that "shared" might also
share the table across users, and this is not what I want. I only wish to be
able to access the table from multiple subs without running code to read it
from the DB in each sub. (but it will be a different table for each user).
Perhaps I need "public" or similar instead?
What should I be doing here for my purpose?
Thanks
Jeff
Shared MyTable As New DataTable
Protected Sub Page_Load ...
If Not Page.IsPostBack Then
MyTable = g.GetTable()
end if
Sub whatever()
MyTable.Rows(Session("Var1"))(Session("Var2"))
End sub
Sub whatever2()
MyTable.Rows(Session("Var3"))(Session("Var4"))
End sub