i've been using asp for years now and dont have much experience with OOP. i have a simple question that i cant find the answer to.
How can i load a dataset(2 datatables) on the Page_load() once and the use those tables on different events.
i have a ddl and a gridview. on the page_load i want to load and populate the dataset - know how to do this
i have a button next to the ddl user selects ddl value and hits button - know how to do this
onclick event of the button is onclick="button_click"
is there a way that i dont have t requery the DB and just use the datatable that i loaded
//connect and fill dataset
//bind the ddl
ddl_yards.DataSource = ds.Tables["Yards"];
ds.Tables["Equip"] // datatable just made and not used yet - make this public so that the other functions can see it. how???????
void button_click(Object Sender, EventArgs e)
// i dont want to reconnect to the db to access the equip table every time the user click this button.
// how can i access the "equip" datatable from inside of here that was made on the Page_load()? so that i can bind it to a gridview - dont know how to do????????
// do i make the dataset public? private?
GridView1.DataSource = ds.Tables["Equip"];