标题:不知道缺少哪个命名空间??
取消只看楼主
huazai2012s
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2012-10-29
结帖率:33.33%
 问题点数:0 回复次数:0 
不知道缺少哪个命名空间??
using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Text;


namespace BegVCSharp_27_1_FirstLINQtoSQLquery
{
    class Program
    {
        static void Main(string[] args)
        {
            NorthwindDataContext NorthwindDataContext = new NorthwindDataContext();
            var queryresults = from c in NorthwindDataContext.customers
                              where c.country = "USA"
                              select new
                              {
                                  ID = c.customerID,
                                  Name = ,
                                  City = c.city,
                                  state = c.regin
                              };
            foreach (var item in queryresults)
            {
                Console.WriteLine(item);
            };
            Console.WriteLine("press enter/return to continue ...");
            Console.ReadKey();
        }
    }
}
Error    1    The type or namespace name 'NorthwindDataContext' could not be found (are you missing a using directive or an assembly reference?)    C:\Users\dell\AppData\Local\Temporary Projects\ConsoleApplication1\Program.cs    15    13    ConsoleApplication1
Error    2    The type or namespace name 'NorthwindDataContext' could not be found (are you missing a using directive or an assembly reference?)    C:\Users\dell\AppData\Local\Temporary Projects\ConsoleApplication1\Program.cs    15    61    ConsoleApplication1



搜索更多相关主题的帖子: 空间 命名 where 
2012-11-13 21:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-386958-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.289979 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved