Пример #1
0
 protected void LstStockList_SelectedIndexChanged(object sender, EventArgs e)
 {
     //create an instance of the collection
     ClassLibrary2.clsStockCollection Stocks = new ClassLibrary2.clsStockCollection();
     //
     LstStockList.DataSource = Stocks.StockList;
     //set the name of the primary key
     LstStockList.DataValueField = "Product_ID";
     //set the data field to display
     LstStockList.DataValueField = "Product_Type";
     //bind the data to the list
     LstStockList.DataBind();
 }
Пример #2
0
 void DisplayStocks()
 {
     //create an instance of the collection
     ClassLibrary2.clsStockCollection Stocks = new ClassLibrary2.clsStockCollection();
     //set data source to the list of countries in the collection
     LstStockList.DataSource = Stocks.StockList;
     //set the name of the primary key
     LstStockList.DataValueField = "Product_ID";
     //set the data field to display
     LstStockList.DataValueField = "Product_Type";
     //bind the data to the list
     LstStockList.DataBind();
 }