Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

I need help to clarify the reasons of the errors

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi there , I have the following code as follows i am facing various errors in the solution in the string, on=objects etc.
errors  are :

1- Error CS0542 'Organization_Manager': member names cannot be the same as their enclosing type
2- Error CS1061 'object' does not contain a definition for 'GetUserNamePassword' and no accessible extension method 'GetUserNamePassword' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormForgotPassword.cs 84 .
3- Error CS0103 The name 'Sql' does not exist in the current context Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormForgotPassword.cs 84 .
4- Error CS0234 The type or namespace name 'Resources' does not exist in the namespace 'Organization_Manager.Properties' (are you missing an assembly reference?) Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormMain.Designer.cs 110 .C#

lOGIN :

2- Forgot password
 
Saloon Keeper
Posts: 15705
367
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

I fixed the code tags in your post so that the code now appears properly formatted. I also moved your post to the C# and .NET forum, and removed it from the C/C++ forum.

I will take a look at your question when I have a little bit more time.
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most of your issues are caused by having a class Organization_Manager inside the namespace Organization_Manager. This is a bad idea. Either rename the namespace or the class.

Problem 3 is caused because of a typo. You probably intended to refer to the local variable "sql", but instead you wrote "Sql".

The last problem might be caused because of a missing resources file. Do you have a Resources.resx inside the Properties folder of your project, and is its build action set to "Embedded Resource"? Does it have a matching Resources.Designer.cs file?
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your contribution , looking forward for your feedback  
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Most of your issues are caused by having a class Organization_Manager inside the namespace Organization_Manager. This is a bad idea. Either rename the namespace or the class.

Problem 3 is caused because of a typo. You probably intended to refer to the local variable "sql", but instead you wrote "Sql".

The last problem might be caused because of a missing resources file. Do you have a Resources.resx inside the Properties folder of your project, and is its build action set to "Embedded Resource"? Does it have a matching Resources.Designer.cs file?



Yes I do have Resources.resx inside properties  folder
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you select it in Visual Studio (if you're using Visual Studio) and look at the properties window, what does it say under Build Action?

Do you also have a Resources.Designer.cs file?
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:When you select it in Visual Studio (if you're using Visual Studio) and look at the properties window, what does it say under Build Action?

Do you also have a Resources.Designer.cs file?



inside Properiteis flder i have AssemblyInfo.cs, Resource,setting.designer.cs, settings.settings
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abdu moh wrote:

Stephan van Hulst wrote:When you select it in Visual Studio (if you're using Visual Studio) and look at the properties window, what does it say under Build Action?

Do you also have a Resources.Designer.cs file?



inside Properiteis flder i have AssemblyInfo.cs, Resource,setting.designer.cs, settings.settings



it says compile
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be exact, and also avoid typos in your posts. We're trying to find the reason it's not working, and a typo in the names of your files could be one such reason.

Again, do you have a Resources.Designer.cs file in your Properties folder? Is its build action set to "Compile"?

Do you have a Resources.resx file in your Properties folder? Is its build action set to "Embedded Resource"?
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have Resources.resx  file and it is assigned to "Embedded Resource"
I  have  Resources.Designer.cs  and it is assigned to " Compile"
and now all related errors are solved, what is remaining errors are

1- Error CS1061 'object' does not contain a definition for 'GetUserNamePassword' and no accessible extension method 'GetUserNamePassword' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormForgotPassword.cs 84
2- Error CS1061 'object' does not contain a definition for 'GetUserNamePassword' and no accessible extension method 'GetUserNamePassword' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormForgotPassword.cs 85

3- Error CS1061 'object' does not contain a definition for 'IsValidNamePass' and no accessible extension method 'IsValidNamePass' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormLogin.cs 72.



 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay so can you show us the updated lines that the error messages refer to?
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Okay so can you show us the updated lines that the error messages refer to?



these are the lines with error type  :
1- 1514 : namespace Organization_Manager.Pal.Forms.User_Control
2-  1061        :  string UserName = Organization_Manager.Organization_Manager.GetUserNamePassword("SELECT User_Name from User_Table where User_Email = '" + textBoxEmail.Text.Trim() + "'; ", sql);
3-  1061       :  string password = Organization_Manager.Organization_Manager.GetUserNamePassword("SELECT User_Pass from User_Table where User_Email = '" + textBoxEmail.Text.Trim() + "'; ", sql);
4-     1061       :  string Check = Organization_Manager.Organization_Manager.IsValidNamePass(textBoxName.Text.Trim(),textBoxPassword.Text.Trim(),sql);


 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you didn't fix the code yet by changing the name of the class or namespace?
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:So you didn't fix the code yet by changing the name of the class or namespace?


Actually i am confused a bit in class and namespace .
and it is not debugging due this massage appears  
CmQDl.png
[Thumbnail for CmQDl.png]
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please right-click the solution and click "Rebuild Solution". Then list the errors you are getting. If they are still the same errors you got at the start, then change the name of the Organization_Manager class to something else. I suggest you just remove the underscore so it becomes OrganizationManager.

Please also post the contents of your .csproj file.
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Please right-click the solution and click "Rebuild Solution". Then list the errors you are getting. If they are still the same errors you got at the start, then change the name of the Organization_Manager class to something else. I suggest you just remove the underscore so it becomes OrganizationManager.

Please also post the contents of your .csproj file.


now I changed the name of the class to be organizationManager and it is solved errors of classs , remainning the following :
1- string Check = OrganizationManager.Organization_Manager.IsValidNamePass(textBoxName.Text.Trim(),textBoxPassword.Text.Trim(),sql);
Severity Code Description Project File Line Suppression State
Error CS1061 'object' does not contain a definition for 'IsValidNamePass' and no accessible extension method 'IsValidNamePass' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormLogin.cs 72 Active
same goes with other forms all related to" object' does not contain a definition"

the .csproj file :
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <PropertyGroup>
   <ProjectView>ShowAllFiles</ProjectView>
   <PublishUrlHistory>publish\</PublishUrlHistory>
   <InstallUrlHistory />
   <SupportUrlHistory />
   <UpdateUrlHistory />
   <BootstrapperUrlHistory />
   <ErrorReportUrlHistory />
   <FallbackCulture>en-US</FallbackCulture>
   <VerifyUploadedFiles>false</VerifyUploadedFiles>
 </PropertyGroup>
 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
   <StartAction>Project</StartAction>
 </PropertyGroup>
</Project>


 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OrganizationManager.Organization_Manager.IsValidNamePass implies that your namespace is called "OrganizationManager", and that the class is named "Organization_Manager", but you just said that you renamed your namespace to "organizationManager".

If you REALLY renamed your class to organizationManager, the line should read:

However, I suspect that you made a typo in your previous post (again, be VERY careful when typing identifiers when you're trying to get help) and you really renamed your class to OrganizationManager. If that's the case, the line should read:
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:OrganizationManager.Organization_Manager.IsValidNamePass implies that your namespace is called "OrganizationManager", and that the class is named "Organization_Manager", but you just said that you renamed your namespace to "organizationManager".

If you REALLY renamed your class to organizationManager, the line should read:

However, I suspect that you made a typo in your previous post (again, be VERY careful when typing identifiers when you're trying to get help) and you really renamed your class to OrganizationManager. If that's the case, the line should read:


yes you are right I updated the class name as mentioned that is the line :
string Check = Organization_Manager.OrganizationManager.IsValidNamePass(textBoxName.Text.Trim(),textBoxPassword.Text.Trim(),sql);
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So is your application compiling now?
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:So is your application compiling now?


no it is not the error of  :
1- Error CS0117 'OrganizationManager' does not contain a definition for 'GetUserNamePassword' Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormForgotPassword.cs 84 .

2-Error CS0117 'OrganizationManager' does not contain a definition for 'IsValidNamePass' Organization Manager C:\Users\Abdu Mohamed\source\repos\Organization Manager\Organization Manager\Pal\Forms\FormLogin.cs 72.

in addition of debugging issue.



 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you also rename the class inside the OrganizationManager.Designer.cs file?
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Did you also rename the class inside the OrganizationManager.Designer.cs file?


I am actually not seeing file named OrganizationManager.Designer.cs in my list , having said that the error i have is about objects definitions that i mentioned in my previous reply .
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post the full source of the OrganizationManager class and the FormForgotPassword class.
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This the formforgotpassword class :

- OrganizationManager class:
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, so the error message is saying that it can't find the methods GetUserNamePassword and IsValidNamePass inside the OrganizationManager class, which shouldn't be very surprising because your OrganizationManager class is empty.
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Okay, so the error message is saying that it can't find the methods GetUserNamePassword and IsValidNamePass inside the OrganizationManager class, which shouldn't be very surprising because your OrganizationManager class is empty.


So how to overcome that .
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you followed a C# tutorial yet? Do you know how to write classes?

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Have you followed a C# tutorial yet? Do you know how to write classes?

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/



I am bet new to C language that's why did not know
 
Stephan van Hulst
Saloon Keeper
Posts: 15705
367
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean the C# language. The C programming language is something completely different.

If you have problems with the programming guide, let us know.
 
Abdu moh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You mean the C# language. The C programming language is something completely different.

If you have problems with the programming guide, let us know.



Yes for sure  it is C# , and i will try rewrite  it correctly and your help is appreciated .
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic