【问题标题】:The type name does not exist in the type c# within InitializeComponent()类型名称在 InitializeComponent() 中的类型 c# 中不存在
【发布时间】:2016-01-29 17:18:31
【问题描述】:

我真的被这个错误困住了,问题是每当我尝试将对象 DataGrid 添加到我的表单并将其链接到我的 SQL 数据库时,我就可以预览数据,这很好。编译时出现上述错误The type does not exit in the type - 当我双击错误时,它会将我带到InitializeComponent() 方法。

这是发生错误的代码示例:

this.wordsDataSet = new SpellingApplication.wordsDataSet();
this.wordListTableAdapter = new wordApplication.wordsDataSetTableAdapters.wordListTableAdapter();

所以我在这个阶段所做的只是从工具箱中选择一个对象DataGrid 将其放置在表单上,​​然后通过小箭头将此对象链接到 SQL,能够预览数据,仅在编译时出现错误.

我已阅读 Stack Overflow 线程,但无法解决问题

在我的项目属性中,我的应用程序设置为 .NET 框架 4.5,构建应用程序目标为 x64 根据此处的一些提示。

任何帮助将不胜感激,如果您能用简单的术语澄清您的答案/提供分步说明,我将非常感激,因为我是 C#/VS2015 的新手

【问题讨论】:

  • 请显示准确和完整的编译器错误。
  • 请说明您到底遇到了什么错误。
  • 首先你要学习如何提出好问题关注这个stackoverflow.com/help/how-to-ask
  • CodeCaster:编译器中的确切错误如下:错误 1 ​​类型名称 'wordsDataSet' 不存在于类型 'SpellingApplication.SpellingApplication' C:\Users\Waheed\OneDrive\Project-TargetDev \UniversalAppSpelling\SpellingApplication\SpellingApplication\frmAmend.Designer.cs 34 57 SpellingApplication

标签: c# initializecomponent


【解决方案1】:

大家好,我已经修复了这个错误

感谢这个踏板The type name 'DatasetTableAdapters' does not exist in the type

我重命名了我的命名空间,因为我的文件夹结构是正确的:

this.wordDataSet = new SpellingApplication.wordDataSet();至 this.wordDataSet = new wordDataSet();这个修复

这也适用于 TableAdapter 再次没有愚蠢的问题要问或某种提问方式,作为一个在软件工程中前进的新手,请随时就这方面的问题提出问题,我将永远乐意提供帮助。

【讨论】:

    猜你喜欢
    • 2013-08-05
    • 1970-01-01
    • 1970-01-01
    • 2020-03-31
    • 1970-01-01
    • 2020-03-05
    • 1970-01-01
    • 2010-12-04
    • 1970-01-01
    相关资源
    最近更新 更多