将行从数据gridviewview传输到另一个datagridview

时间:2015-05-24 14:28:12

标签: c# entity-framework datagridview

如何将行从datagridview转移到另一个datagridview

我正在使用实体框架。

以下是我的尝试:

 dataGridView1.DataSource = (from movie in movieEntities.Movie.ToList()
                                        join inventory in movieEntities.MovieInventory.ToList()
                                        on movie.MovieID equals inventory.MovieID
                                        join genre in movieEntities.Genre.ToList()
                                        on movie.GenreID equals genre.GenreID
                                        select new 
                                        {
                                            ID = movie.MovieID,
                                            Title = movie.MovieName,
                                            Quantity = inventory.TotalQuantity,
                                            Price = movie.Price,
                                        }).ToList();

0 个答案:

没有答案