Resolved Manuel_Eingabe is a namespace but it is used as a type

Govind Sankar

Active member
Joined
May 15, 2020
Messages
42
Programming Experience
Beginner
Hi,

I have a big application with a main window. The application is in wpf. I need to enter some values. So I created a second window called Manuel_Eingabe to enter the values. Now in the main window I made a button and created an eventhandler as click. Now when we click on the button, I need to open the second window. So for that I am writing this code :

var use = new Manuel_Eingabe();
use.ShowDialog();

But in the first line it is showing an error : 'Manuel_Eingabe' is a namespace but it is used as a type.

I dont understand why it is happening since the namespace is actually DatenbankInterface.

Please help me correct this.
1.jpg
2.jpg
3.jpg
 
For future reference, please put some thought into what you post and post all that is relevant and ONLY what is relevant. We don't need several screenshots of your entire screen when 70-80% of it is blank. We also don't need a screenshot of code when you can post the actual code and just the part of the code that is relevant to the problem.
 
Last edited:
No it isn't, you have two namespaces defined here separated with dot: View attachment 1014
I tried removing the manuel eingabe part and just use datenbank interface as the namespace but when I do that it is showing an error for the functions below like Intialize Component. So how can i correct this.
 
If you move a type out of a namepsace then it no longer has unqualified access to the other types in that namespace. You need to move all the other types too. Instead of just removing that child namespace, try putting some thought into what you're doing. Namespaces are supposed to group types together into areas of related functionality. Either the namespaces you have make sense or they don't. If they don't, why do you have them at all? If they do, think about proper names for them. It should not be hard to come up with a name for a type that is not the same as the name of the namespace it's a member of if both are named sensibly. Is "Manuel_Eingabe" German for "Manual_Entry"? That's what seemed to be the case based on a quick search I did. I don't see how it could be hard to differentiate a type and a namespace in that case. For one thing, a window should have "Window" or "Dialogue" or the like in the name.
 
If you move a type out of a namepsace then it no longer has unqualified access to the other types in that namespace. You need to move all the other types too. Instead of just removing that child namespace, try putting some thought into what you're doing. Namespaces are supposed to group types together into areas of related functionality. Either the namespaces you have make sense or they don't. If they don't, why do you have them at all? If they do, think about proper names for them. It should not be hard to come up with a name for a type that is not the same as the name of the namespace it's a member of if both are named sensibly. Is "Manuel_Eingabe" German for "Manual_Entry"? That's what seemed to be the case based on a quick search I did. I don't see how it could be hard to differentiate a type and a namespace in that case. For one thing, a window should have "Window" or "Dialogue" or the like in the name.
Thank You. I corrected it, I created a folder in the project in Visual Studio and called it also Manuel Eingabe and that is why the namespace was Datenbank Interface. Manuel Eingabe. I completely redid it by creating a new folder called Manuel and then the namespace is DatenbankInterface.Manuel and the class name is Manuel Eingabe. When they both had different names the function worked. Thank You. And yes Manuel Eingabe means Manuel Entry. Even though my first language is English, I work in a German Company in Germany, so have to use German terms.
 
Back
Top Bottom