namespace WpfApplication1
{ public partial class MainWindow : Window
{
private HellokittyEntities1 HellokittyContext = null;
private Product product = null;
public MainWindow()
{
InitializeComponent();
} private void Window_Loaded(object sender, RoutedEventArgs e)
{ this.HellokittyContext = new HellokittyEntities1();
this.productList.DataContext = HellokittyContext.Products; } private void productList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.product = productList.SelectedItem as Product;
??????
}
}
}
代码如上,创建的数据库实体模型。在comobobox中选择产品的ID,怎么查询到产品的其它信息。
{ public partial class MainWindow : Window
{
private HellokittyEntities1 HellokittyContext = null;
private Product product = null;
public MainWindow()
{
InitializeComponent();
} private void Window_Loaded(object sender, RoutedEventArgs e)
{ this.HellokittyContext = new HellokittyEntities1();
this.productList.DataContext = HellokittyContext.Products; } private void productList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.product = productList.SelectedItem as Product;
??????
}
}
}
代码如上,创建的数据库实体模型。在comobobox中选择产品的ID,怎么查询到产品的其它信息。
{
this.product = productList.SelectedItem as Product;
??????
}
这个product 不是已经有了所有的产品信息的嘛 ?
多写写就知道了。