0

我正在尝试使用 DataContext 方法。但是当我键入以下代码 'private NorthWindDataContext Context' 时,它给了我一个错误,说在命名空间中找不到它。我如何使用 DataContext 或者我在这方面缺少什么。

public partial class Northwind
{
    private NorthwindDataContext Context
    {
        get;
        set;
    }

    public Northwind()
    {
        Context = new NorthwindDataContext();
    }
4

1 回答 1

0

Right click on NorthWindDataContext and select Resolve, It will get you the namespace (if you have). You can do the same thing with keyboard. Put your cursor on NorthWindDataContext and press Cntl+. (dot) and select the namespace to use

于 2012-04-20T19:09:17.713 回答