views:

41

answers:

2

In the designer.cs portion of the code, I simply made the combo boxes database driven (it previewed the data fine, so that works) but when I try to compile, it throws me a 2 unique errors:

1) Error 1 The type name 'mtdDesktopApplicationDataSet' does not exist in the type 'DesktopApplication.DesktopApplication'

2) Error 2 The type name 'mtdDesktopApplicationDataSetTableAdapters' does not exist in the type 'DesktopApplication.DesktopApplication'

The first error is on the first line, the other error shows up wherever 'mtdDesktopApplicationDataSetTableAdapters' is (4 lines)

All the appropriate files appear to be there, but they just aren't hooking up right?

this.mtdDesktopApplicationDataSet = new DesktopApplication.mtdDesktopApplicationDataSet();
this.tblStudyBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tblStudyTableAdapter = new DesktopApplication.mtdDesktopApplicationDataSetTableAdapters.tblStudyTableAdapter();
this.tblDeliveryGroupBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tblDeliveryGroupTableAdapter = new DesktopApplication.mtdDesktopApplicationDataSetTableAdapters.tblDeliveryGroupTableAdapter();
this.tblDeliveryBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tblDeliveryTableAdapter = new DesktopApplication.mtdDesktopApplicationDataSetTableAdapters.tblDeliveryTableAdapter();
this.tblDeliveryDataSetBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tblDeliveryDataSetTableAdapter = new DesktopApplication.mtdDesktopApplicationDataSetTableAdapters.tblDeliveryDataSetTableAdapter();
 ((System.ComponentModel.ISupportInitialize)(this.mtdDesktopApplicationDataSet)).BeginInit();
 ((System.ComponentModel.ISupportInitialize)(this.tblStudyBindingSource)).BeginInit();
 ((System.ComponentModel.ISupportInitialize)(this.tblDeliveryGroupBindingSource)).BeginInit();
 ((System.ComponentModel.ISupportInitialize)(this.tblDeliveryBindingSource)).BeginInit();
 ((System.ComponentModel.ISupportInitialize)(this.tblDeliveryDataSetBindingSource)).BeginInit();
+2  A: 

Have you moved/renamed the files/classes at any point, and/or changed the project's default namespace? I've seen all of these have similar effects to the above.

Re the (generated) line:

this.mtdDesktopApplicationDataSet =
        new DesktopApplication.mtdDesktopApplicationDataSet();

It is probably worth avoiding having fields (this.mtdDesktopApplicationDataSet) named the same as types (DesktopApplication.mtdDesktopApplicationDataSet) - that can only lead to potential for bugs. It isn't clear (without being able to reproduce it) whether that is a factor here, but it can't help any...

What is the field mtdDesktopApplicationDataSet meant to represent? Can you rename it?

Marc Gravell
Not to my knowledge. The project was recently moved to the server instead of my local machine but that was prior to this, and everything else seems to work fine.
scrot
Appears I indeed had a messed up namespace issue. Thanks.
scrot
+2  A: 

I'm guessing you're experiencing some issues with namespaces. If this code-behind file resides in the DesktopApplication namespace and you also have a DesktopApplication class in the DesktopApplication namespace, you will experience the above.

(Basically it's looking at DesktopApplication.DesktopApplication when it should be looking at DesktopApplication instead.)

Try cleaning up your namespaces so the above is not true, or escape the namespace hell with the global keyword:

this.mtdDesktopApplicationDataSet = new global::DesktopApplication.mtdDesktopApplicationDataSet();
lc
I went ahead and (temporarily) used your global escape method. I'll clean it up, but this worked! Thank you!
scrot