Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NET数据访问层教程-TableAdapter错误_Asp.net_Database - Fatal编程技术网

ASP.NET数据访问层教程-TableAdapter错误

ASP.NET数据访问层教程-TableAdapter错误,asp.net,database,Asp.net,Database,错误:: 找不到类型或命名空间名称“NorthwindTableAdapters”。是否缺少using指令或程序集引用 我遵循下面的教程,完全按照它所说的做 但是得到了这个错误…想尽一切办法让它消失 使用NorthwindTableAdapters在我的文件中添加了代码行; 尝试过的步骤如以下问题的答案所示 几个问题: 是否应该有NorthWindAdapter类,因为我在解决方案资源管理器中看不到 我的数据库名也是myDB,所以我需要使用myDBTableAdapters进行编写;而不是使用N

错误::

找不到类型或命名空间名称“NorthwindTableAdapters”。是否缺少using指令或程序集引用

我遵循下面的教程,完全按照它所说的做

但是得到了这个错误…想尽一切办法让它消失

使用NorthwindTableAdapters在我的文件中添加了代码行; 尝试过的步骤如以下问题的答案所示 几个问题:

是否应该有NorthWindAdapter类,因为我在解决方案资源管理器中看不到

我的数据库名也是myDB,所以我需要使用myDBTableAdapters进行编写;而不是使用NorthwindTableAdapters??我确实试过了,但没用

我的代码:-

Default.aspx

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
AllProducts.aspx

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NorthwindTableAdapters; 


public partial class AllProducts : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ProductsTableAdapter productsAdapter = new ProductsTableAdapter(); 
        GridView1.DataSource = productsAdapter.GetProducts(); 
        GridView1.DataBind(); 
    }
}
我应该在这里键入xsd文件的代码吗

怎么了??救命啊

有两件事:

以防万一,请确保数据集所在的DLL位于web应用程序的bin中,并且 仔细检查设计器生成的文件,并检查表适配器的名称空间。Ctrl+F并键入ProductStableApter,然后向上钻取以查找命名空间。。。通常名称空间较长。 嗯