日期:2014-05-18  浏览次数:20773 次

(急)c#数据源编译问题(急)
使用vs示例数据库Northwind,将数据源的一个库表直接拖放到form上,自动生成DataGridView控件。但是在编译的时候产生如下的两个错误。
1、The type name 'NorthwindDataSet' does not exist in the type 'GettingData.GettingData'。
2、The type name 'NorthwindDataSetTableAdapters' does not exist in the type 'GettingData.GettingData'。

错误产生处的代码如下:
1、this.northwindDataSet = new GettingData.NorthwindDataSet();
2、this.customersTableAdapter = new GettingData.NorthwindDataSetTableAdapters.CustomersTableAdapter();

如果将两个语句中的GettingData去掉的话,就能正常编译,即修改为如下:
1、this.northwindDataSet = new NorthwindDataSet();
2、this.customersTableAdapter = new NorthwindDataSetTableAdapters.CustomersTableAdapter();

问:1、这是什么原因?
  2、像这种vs自动生成的且不能编译通过的错误,应该如何应对?


------解决方案--------------------
看看是不是因为不是全局的造成的
------解决方案--------------------
说的很清楚了 'NorthwindDataSet' does not exist in the type 'GettingData.GettingData'。 
在'GettingData.GettingData'这个命名空间下找不到'NorthwindDataSet' 这个方法;
其实你的命名空间是在'GettingData‘;
多了层命名空间 你不把代码贴出来 不知道什么原因