且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

linq到sql的简单复制查询查询>/?/

更新时间:2023-02-17 17:23:58

除了您自己的自定义代码之外,您还没有做很多事情,但是我有一个 LINQ示例 [
You haven''t given much to go on apart from your own custom code, but I''d have a read of this LINQ Samples[^]

But this is taken from the article

public void Linq47() 
{ 
    List<product> products = GetProductList(); 
  
    var categoryNames = ( 
        from p in products 
        select p.Category) 
        .Distinct(); 
  
    Console.WriteLine("Category names:"); 
    foreach (var n in categoryNames) 
    { 
        Console.WriteLine(n); 
    } 
}
</product>



如果您能解释更多问题,我们也许可以为您提供更好的答案.



If you could explain where you are stuck more then we may be able to give you a better answer.