ASP.net DAL DatasSet and Table Adapter not in namespace - Northwind Tutorial

别等时光非礼了梦想. 提交于 2019-12-02 03:39:21

I also had the same problem and finally found the solution. try followings; 1) Right click on your DataSet and select properties 2) Under the dataset properties, set a name for Prifix property. 3) debug your application. 4) in your application(C#.net) import the namesapce as using DALexample.MyTableAdapters;

DALexample is your project name...

You need to compile the code after creating the xsd file, but before you add code to the use the table adapter.

So, looking at the tutorial, before you create the AllProducts.aspx, you need to build the code. This will auto-generate the NorthwindTableAdapters namespace and the code behind it you will need to continue on with the tutorial

Your web project must have been duplicated for some reson. Create an entirely new web project and copy all your current code to it. Then try to run. it will work.

I got stumped on this for a bit also - the problem is likely that you created the project using New Project->ASP.NET Web Application. An Application project isn't the same thing as a Web Site project. Create a project using New Web Site->ASP.NET Web Site. Then drop all tutorial files into the root folder in Solution Explorer overwriting all.

I noticed something was up when I tried to recreate the DataSet and the wizard didn't autostart asking me to put it the App_Code folder. The App_Code folder must be specific to ASP.NET Web Sites and not Applications.

Go to the web.config file and under Pages - namespaces, see if there is a clear command, try removing the clear command:

<pages styleSheetTheme="DataWebControls">
  <namespaces>
    <clear/>

For me, instead of needing to create a new website and copying all of the source files (except the web.config file) to it, I was just able to make a backup of my web.config file, then delete the web.config file, then go to add new item and add a new web.config file, that created a new file with the defaults I needed, then I just copyed the custom entries from my old web.config file to the new one, and I was good to go.

I was also struggling with this but solved it by closing down Visual Studio, reopening my project, and finally building the solution (CTRL+SHIFT+B).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!