不知道缺少哪个命名空间??
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