G
Guest
Hello,
In my vb2005 app I create 3 datatables in the Datasource area, tbl1, tbl2,
tbl3. tbl1 contains 1 column, tbl2 contains 2 columns tbl3 contains 3
columns.
Based on selections from a form, I want to populate on 1 of the 3 tables
with data and use the selected table throughout some procedure - the table
and the data that it contains will have to persist throughout the life of the
application. So instead of having a bunch of If-Then statements for each
table I want to hold the selected table (the actual table - not a copy of the
table) in some collection object. I guess dTbl() would be a reference to the
selected table (or a pointer to the selected table in C++)
Here is something I tried that is not working
Dim dTbl() as DataTable = New DataTable(){}
If strSelected.Equals("tbl1") then dTbl(0) = dataset.tbl1
If strSelected.Equals("tbl2") then dtbl(0) = dataset.tbl2
If strSelected.Equals("tbl3") then dTbl(0) = dataset.tbl3
So the idea is that dTbl(0) would be used throughout the app, but when
dTbl(0) gets populated, it is actually dataset.tbl1 (or 2 or 3) that is being
populated. What object can I use to do this?
Thanks,
Rich
In my vb2005 app I create 3 datatables in the Datasource area, tbl1, tbl2,
tbl3. tbl1 contains 1 column, tbl2 contains 2 columns tbl3 contains 3
columns.
Based on selections from a form, I want to populate on 1 of the 3 tables
with data and use the selected table throughout some procedure - the table
and the data that it contains will have to persist throughout the life of the
application. So instead of having a bunch of If-Then statements for each
table I want to hold the selected table (the actual table - not a copy of the
table) in some collection object. I guess dTbl() would be a reference to the
selected table (or a pointer to the selected table in C++)
Here is something I tried that is not working
Dim dTbl() as DataTable = New DataTable(){}
If strSelected.Equals("tbl1") then dTbl(0) = dataset.tbl1
If strSelected.Equals("tbl2") then dtbl(0) = dataset.tbl2
If strSelected.Equals("tbl3") then dTbl(0) = dataset.tbl3
So the idea is that dTbl(0) would be used throughout the app, but when
dTbl(0) gets populated, it is actually dataset.tbl1 (or 2 or 3) that is being
populated. What object can I use to do this?
Thanks,
Rich