私のフォームでは、次のものがあります...
if (productNo == this.product1.ProductNumber) //ProductNumber comes from Product class
{
//if so, set the other values of the text boxes to that of the
//product in memory
tbDescription.Text = product1.ProductDescription; //Works - from Product class
tbOnHand.Text = product1.NumberOnHand.ToString(); //Works - from Product class
tbUnitOfMeasure.Text = product1.UnitOfMeasure; //Works - from Product class
tbVendorID.Text = product1.VendorID; // Doesn't work - from derived ManufacturedProduct class
}
VendorID は、Product から派生したクラスである ManufacturedProduct クラスから取得されます。コードの最後の行は、機能しないものです。tbVendorID に product1.VendorID (ちなみに int) の値を入力できるようにしたい
次のエラーが表示されます...Objects.Product に 'VendorID' の定義が含まれておらず、タイプ 'Objects.Product' の最初の引数を受け入れる拡張メソッド 'VendorID' が見つかりませんでした (using ディレクティブまたはアセンブリ参照?)