《Scott Mitchell 的ASP.NET 2.0数据教程》之二 BLL层 学习过程中的问题

前几日有学员反映按照《 Scott Mitchell 的ASP.NET 2.0数据教程之二》中的例子仿写,结果无法运行程序,报错误,找不到名为"NorithwindTableAdapters"的命名空间,导致程序无法运行。
出错信息为:“ 错误 1 找不到类型或命名空间名称“NorithwindTableAdapters”(是否缺少 using 指令或程序集引用?) D:\Code\Northwind\Web\App_Code\BLL\Categories.cs 10 7 D:\...\Web\
”。
遇到这种问题可以通过GOOGLE搜索,得到想要的答案,老外是这样回答的(参见 http://forums.asp.net/t/1010504.aspx):
 I was able to fix this, though I still don't understand why it happens.

As Mr. Freeman (great job against the Xen, by the way) mentioned, the namespace is auto-generated by VS.Net. You can find out what namespace it created by opening the Class View and looking for the namespace objects (they look like braces: {}), in my case:
namespace Northwind sTableAdapters;
Notice the bold "s"? Changing the code to this namespace worked. Why VS did this I have no idea, neither VS nor the tutorial gives any indication where this name comes from.

I typed the code in myself rather than downloading it; I find I don't learn anything by downloading and running samples.
意思就是说:请打开你VS.NET 2005的“类视图”窗口,查找你的命名空间究竟为什么,注意这里的命名空间应该是带" S"的命名,然后在程序中引用即可。

另外,其中用到了设计模式的“单件”模式,不清楚的同学请Google相关资料。

转载于:https://www.cnblogs.com/koon/archive/2008/02/18/1071769.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值